I have a pandas DataFrame with 4 columns and I want to create a new DataFrame that only has three of the columns. This question is similar
As far as I can tell, you don't necessarily need to specify the axis when using the filter function.
new = old.filter(['A','B','D'])
returns the same dataframe as
new = old.filter(['A','B','D'], axis=1)