Dropping Multiple Columns from a dataframe

To delete multiple columns at the same time in pandas, you could specify the column names as shown below. The option inplace=True is needed if one wants the change affected column in the same dataframe. Otherwise remove it.

flight_data_copy.drop(['TailNum', 'OriginStateFips', 
                'DestStateFips', 'Diverted'], axis=1, inplace=True)

Source: Python Pandas – Deleting multiple series from a data frame in one command

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.