Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to pick out separate columns from the pandas dataframe object

df1 = df.iloc[:, 0:2] # If you want to do it by index. Remember that Python does not slice inclusive of the ending index.
df1 = df[['a', 'b']] ## if you want to do it b nae
Comment

PREVIOUS NEXT
Code Example
Python :: list to sentence python 
Python :: python put quotes in string 
Python :: python kill process by name 
Python :: getting multiple selected value django 
Python :: string to list separated by space python 
Python :: how to underline text in tkinter 
Python :: rename key in dict python 
Python :: swap list items in python 
Python :: describe function in pandas 
Python :: python save output to file 
Python :: python do something before exit 
Python :: python [remote rejected] master - master (pre-receive hook declined) 
Python :: what is pypy 
Python :: Row wise mean pandas 
Python :: get list file in folder python 
Python :: convert dict to dataframe 
Python :: how to change background of tkinter window 
Python :: cut part of video ffmpeg 
Python :: pandas read first column as index 
Python :: how to get synonyms of a word in python 
Python :: networkx path between two nodes 
Python :: django query field is null 
Python :: python 2 decimal places format 
Python :: python range of letters 
Python :: python palindrome 
Python :: malier module python 
Python :: python decimal to string 
Python :: python send get request with headers 
Python :: print index of tuple python 
Python :: add time to datetime python 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =