Pandas: can't drop columns: ValueError: labels [<colName>] not contained in axis

Viewed 7609

I have a df created from a simple CSV. When I try to reference columns by their names, to merge into a new df or to drop, I am getting a

ValueError: labels [<colName>] not contained in axis

I understand that to drop a column you must use

axis=1

It's as if somehow the df is confused that my columns are the columns, even though they are the top row and bolded when viewed in iPython.

1 Answers
Related