Answers for "select certain columns from dataframe pandas"

1

select columns from dataframe pandas

df = df.iloc[:,0:2] # this selects first two columns
df = df[['column1', 'column2']]
Posted by: Guest on January-22-2022
0

get particular columns from dataframe

x, y = df.iloc[:, [0]], df.iloc[:, [1]]
Posted by: Guest on October-27-2021

Code answers related to "select certain columns from dataframe pandas"

Python Answers by Framework

Browse Popular Code Answers by Language