For a pandas DataFrame, I can drop any existing columns using
data.drop([col], axis=1)
If I want to drop several columns, as long as they all exist in the data, I can drop them all at once using
data.drop(list_of_cols, axis=1)
How can I drop several columns if some do not exists. I want to make sure none of the columns in my list are in the data.
Is there a standard way to drop a list of columns ignoring those that do not exist instead of throwing KeyError.