df.drop(colname, axis=1)
(or del df[colname]
) is the correct method to use to delete a column.
If a ValueError
is raised, it means the column name is not exactly what you think it is.
Check df.columns
to see what Pandas thinks are the names of the columns.