Asked • 04/19/19

Delete column from pandas DataFrame?

When deleting a column in a DataFrame I use: del df['column_name']And this works great. Why can't I use the following? del df.column_name*As you can access the column/Series as `df.column_name`, I expect this to work.*

1 Expert Answer

By:

Andrew C. answered • 04/19/19

Tutor
New to Wyzant

Experienced Programming Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.