You should check the documentation of pandas.DataFrame.drop and version of pandas you are using (for example 'columns' is available from pandas 0.21)
It works for me with my dummy dataframe both with labels and with columns:
-
-
If you want change the dataframe then you should set inplace:
-
EDIT:
ninjad by ThomasL
I used this code to create dummy dataframe:
It works for me with my dummy dataframe both with labels and with columns:
-
df.drop(labels='(Vol., Price, Open, High, Low)', axis=1)
-
df.drop(columns='(Vol., Price, Open, High, Low)')
If you want change the dataframe then you should set inplace:
-
df.drop(columns='(Vol., Price, Open, High, Low)', inplace=True)
EDIT:
ninjad by ThomasL
I used this code to create dummy dataframe:
df = pd.DataFrame({'numbers': range(1, 4), 'letters': [*'abc'], '(Vol., Price, Open, High, Low)': 42})
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.