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
2 months agoBulah
21 days agoKirby
29 days agoFannie
1 months agoDolores
2 months agoVincent
2 months agoSolange
2 months agoBambi
2 months agoDenna
2 months agoMy
2 months agoGlory
3 months agoAudry
2 months agoDulce
2 months agoCandra
3 months agoSylvie
3 months agoPilar
2 months agoEdgar
2 months agoAmalia
2 months agoBarbra
3 months agoIvette
3 months agoLynelle
3 months agoKimberely
2 months agoDominic
2 months agoDominga
2 months agoHuey
3 months ago