Course Content
Preprocessing Data
Preprocessing Data
Removing Duplicates
To remove the duplicate rows, simply use function drop_duplicates()
. To change the current dataframe, add inplace=True
.
new_data = data.drop_duplicates() # data is not modified # or data.drop_duplicates(inplace=True) # data is modified
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.
Everything was clear?
Removing Duplicates
To remove the duplicate rows, simply use function drop_duplicates()
. To change the current dataframe, add inplace=True
.
new_data = data.drop_duplicates() # data is not modified # or data.drop_duplicates(inplace=True) # data is modified
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.
Everything was clear?
Removing Duplicates
To remove the duplicate rows, simply use function drop_duplicates()
. To change the current dataframe, add inplace=True
.
new_data = data.drop_duplicates() # data is not modified # or data.drop_duplicates(inplace=True) # data is modified
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.
Everything was clear?
To remove the duplicate rows, simply use function drop_duplicates()
. To change the current dataframe, add inplace=True
.
new_data = data.drop_duplicates() # data is not modified # or data.drop_duplicates(inplace=True) # data is modified
Task
The planets
dataset is given to you. Remove the duplicates and then check the new shape of dataframe. Compare it with the original shape.
Note that dataframe may have only distinct records, in this case, the shape will remain the same.