Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
What DataFrames are
DataFrame columns
16. Removing a column
DataFrame rows
Filtering rows and columns
Filtering data frames
Sorting rows


Great. To remove a column, use data_frame.drop():

hospitals.drop('Full City', axis = 1)

The drop() function takes two arguments: the name of the column to remove, and the information about the axis. In pandas DataFrames, axis = 0 means rows, and axis = 1 means columns. Here, we want to get rid of a column, so we use axis = 1.

Removing columns from a DataFrame is not very common in data analysis. Still, it's good to know how to do it.


Remove the GDP Per Capita column from eu_states.

Stuck? Here's a hint!


eu_states.drop('GDP Per Capita',axis=1)