Pandas Drop Duplicates | pd.DataFrame.Drop_Duplicates()

Опубликовано: 13 Октябрь 2024
на канале: Greg Kamradt (Data Indy)
3,189
52

https://dataindependent.com/pandas/pa...

Do you ever have repeat rows in your data when you don't want to? Pandas Drop duplicates will remove these for you.

Pandas DataFrame.drop_duplicates() will remove any duplicate rows (or duplicate subset of rows) from your DataFrame. It is super helpful when you want to make sure you data has a unique key or unique rows.

I use this function most when I have a column that represents a unique id of an object. I'll run .drop_duplicates() specifying my unique column as the subset.