US Census Data Drop Duplicates

https://www.codecademy.com/paths/data-science/tracks/practical-data-cleaning/modules/data-cleaning-with-pandas/projects/data-cleaning-us-census

duplicates = us_census.State.duplicated()
print(duplicates.value_counts())
us_census = us_census.drop_duplicates()
print(us_census)

I checked the state column for duplicates and found there were.

At first I didnt use .State and it returned no duplicates so then I included .State

But when I try to drop duplicates, it doesn’t work. The df us_census is still the same including the duplicates.

Not sure what I am doing wrong here.

I tried to include .State but that would only return the State column

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.