Answers for "python drop column 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
0

how to drop the index column in pandas

df.reset_index(drop=True)
Posted by: Guest on September-17-2020
1

removing features pandas

df.drop([‘feature_1’,’feature_2’], inplace = True, axis = 1)
Posted by: Guest on May-22-2020
1

remove columns from a dataframe python

df = df.drop(df.columns[[0, 1, 3]], axis=1)  # df.columns is zero-based pd.Index
Posted by: Guest on May-20-2020

Python Answers by Framework

Browse Popular Code Answers by Language