Removing Duplicates
To remove the duplicate rows, simply use function drop_duplicates()
. To change the current dataframe, add inplace=True
.
123new_data = data.drop_duplicates() # data is not modified # or data.drop_duplicates(inplace=True) # data is modified
Swipe to start coding
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.
Lösning
Tack för dina kommentarer!
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Sammanfatta detta kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 5.56
Removing Duplicates
Svep för att visa menyn
To remove the duplicate rows, simply use function drop_duplicates()
. To change the current dataframe, add inplace=True
.
123new_data = data.drop_duplicates() # data is not modified # or data.drop_duplicates(inplace=True) # data is modified
Swipe to start coding
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.
Lösning
Tack för dina kommentarer!
Awesome!
Completion rate improved to 5.56single