Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Missing values
Duplicate rows
8. Remove duplicates
Outliers
Joining datasets
Summary

Instruction

Good! Duplicates are usually a problem because they distort analysis results. For instance, they may shift the mean value.

Luckily, it's extremely easy to get rid of them in pandas. For our cars DataFrame, all you have to do is write:

cars.drop_duplicates()

Exercise

Remove duplicate rows from states_sales and store the result in the states_sales variable.

Stuck? Here's a hint!

Use:

states_sales = states_sales.drop_duplicates()