Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get only certain columns in pandas

#only the column names specified will be put into the new sub df
#enter a minimum of one column name
print(df[['column_name_1', 'column_name_2', ... , 'column_name_n']])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #columns #pandas
ADD COMMENT
Topic
Name
7+2 =