Drop Duplicate Values in a Pandas DataFrame Column
Python
Data Preprocessing
1| # Will drop any rows that contain duplicate values in the Name column 2| # but will keep the first row that contains a duplicated value 3| df.drop_duplicates(subset=['Name'], inplace=True) 4| 5| # Will drop any rows that contain duplicate values in the Name column 6| # but will keep the last row that contains a duplicated value 7| df.drop_duplicates(subset=['Name'], keep='last', inplace=True) 8| 9| # Will drop any rows that contain duplicate values in the Name column 10| df.drop_duplicates(subset=['Name'], keep=False, inplace=True)
4
4
3
3
2
How to Remove Punctuation From Text with Python
Python
Data Preprocessing
Nlp | String | Punctuation
2
2
How to Create Different Aggregations Using GroupBy, Agg & Dictionaries
Python
Data Preprocessing
2
2
2