Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Data Science by (17.6k points)

When we create list using the below code, we get the list of all the columns but I want to get the list of only 3 to 5 specific columns.

col_list= list(df)

1 Answer

0 votes
by (41.4k points)

Here, for getting the list of only 3 to 5 specific columns you can use slicing of list:


If you wish to learn more about how to use python for data science, then go through this data science python course by Intellipaat for more insights.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94k users

Browse Categories