Which Python method can be used to Remove duplicates by Data scientist?
The drop_duplicates() method removes duplicate rows.
dataframe.drop_duplicates(subset, keep, inplace, ignore_index)
Remove duplicate rows from the DataFrame:
1. import pandas as pd
2. data = {
3. 'name': ['Peter', 'Mary', 'John', 'Mary'],
4. 'age': [50, 40, 30, 40],
5. 'qualified': [True, False, False, False]
6. }
7.
8. df = pd.DataFrame(data)
9. newdf = df.drop_duplicates()
Emelda
3 months agoBulah
1 months agoKirby
2 months agoFannie
2 months agoDolores
3 months agoVincent
3 months agoSolange
3 months agoBambi
3 months agoDenna
3 months agoMy
3 months agoGlory
3 months agoAudry
3 months agoDulce
3 months agoCandra
3 months agoSylvie
3 months agoPilar
2 months agoEdgar
3 months agoAmalia
3 months agoBarbra
4 months agoIvette
4 months agoLynelle
4 months agoKimberely
2 months agoDominic
3 months agoDominga
3 months agoHuey
3 months ago