Project us census

https://www.codecademy.com/paths/data-science/tracks/dscp-data-wrangling-and-tidying/modules/dscp-data-cleaning-with-pandas/projects/data-cleaning-us-census
I am stuck at 10th checkpoint in this project where i can’t run duplicate() method on my dataframe or my list, it is showing error.
Please can anyone help me?
Thanks in Advance :blush:

Hi, what’s the error you receive?

Did you do this first?
print(us_census.duplicated())

" print(census.duplicated())
AttributeError: ‘list’ object has no attribute ‘duplicated’ "

Yes I did try that, I am getting the above error, I might have made some mistake in the code.

It might be helpful to go back and review “Dealing with Duplicates” in the lesson here:
https://www.codecademy.com/paths/data-science/tracks/dscp-data-wrangling-and-tidying/modules/dscp-data-cleaning-with-pandas/lessons/pandas-data-cleaning/exercises/duplicates

.duplicated() method documentation also here:

Also, the .drop_duplicates() method is used on the df. But, you have to create a new df.
Like so: new_df = old_df.drop_duplicates()

1 Like