Answers for "delete column pandas by index"

1

python pandas drop column by index

df.drop(a_dataframe.columns[0], axis=1, inplace=True)
Posted by: Guest on May-09-2021
3

get column number in dataframe pandas

# PANDAS: get column number from colomn name
dataframe.columns.get_loc("<col_name>")
Posted by: Guest on February-22-2020
2

dataframe delete row

df.drop(df.index[2])
Posted by: Guest on May-26-2020
0

how to access dataframe row by datetime index

df.loc['2008-01-01']
Posted by: Guest on April-12-2020
0

remove column by index

df.drop(list(df)[2:5], axis=1)
Posted by: Guest on August-13-2021

Code answers related to "delete column pandas by index"

Python Answers by Framework

Browse Popular Code Answers by Language