1yourdf.drop(['columnheading1', 'columnheading2'], axis=1, inplace=True)
1#To delete the column without having to reassign df
2df.drop('column_name', axis=1, inplace=True)
1# Let df be a dataframe
2# Let new_df be a dataframe after dropping a column
3
4new_df = df.drop(labels='column_name', axis=1)
5
6# Or if you don't want to change the name of the dataframe
7df = df.drop(labels='column_name', axis=1)
8
9# Or to remove several columns
10df = df.drop(['list_of_column_names'], axis=1)
11
12# axis=0 for 'rows' and axis=1 for columns
1df.drop(['column_1', 'Column_2'], axis = 1, inplace = True)
2# Remove all columns between column index 1 to 3
3df.drop(df.iloc[:, 1:3], inplace = True, axis = 1)