Search
 
SCRIPT & CODE EXAMPLE
 

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']])
Comment

PREVIOUS NEXT
Code Example
Python :: python tkinter treeview get selected item 
Python :: python join two lists as dictionary 
Python :: python print string separated by comma 
Python :: emoji in python 
Python :: force utf-8 encoding python 
Python :: how to print all combinations of a string in python 
Python :: label encode one column pandas 
Python :: python socket recv timeout 
Python :: python get lines from text file 
Python :: boolean python meaning for idiots 
Python :: Violin Plots in Seaborn 
Python :: __name__== __main__ in python 
Python :: pandas convert float to int with nan null value 
Python :: holidays python 
Python :: how to print all rows in pandas 
Python :: check numpy arrays equal 
Python :: pyspark groupby sum 
Python :: write number of lines in file python 
Python :: python how to change size of a window 
Python :: python split sentence into words 
Python :: how to add row in spark dataframe 
Python :: grab a href using beuatiful soup 
Python :: %matplotlib inline 
Python :: how to count number of unique values in a column python 
Python :: discord get user slash command 
Python :: amazon response 503 python 
Python :: remove a char in a string python 
Python :: pandas iterate columns 
Python :: how to write your first python program 
Python :: rotate array python 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =