herbert ichama
herbert ichama

Reputation: 81

Pandas Dataframe Drop both records and their duplicates

I want drop records that have duplicates and their duplicates in pandas Dataframe based on a column

Upvotes: 0

Views: 537

Answers (1)

nitin3685
nitin3685

Reputation: 855

df.drop_duplicates(subset='column_name',keep=False)

drop_duplicates will drop duplicated

subset will allow you the specify based on which column you want to determine duplicated

keep will allow you to specify which record to keep or drop.

drop_duplicates : Please check this link for more info.

Upvotes: 1

Related Questions