What is the syntax for removing duplicate rows in pandas (where all of the columns match)?

What is the syntax for removing duplicate rows of a pandas dataframe (where all of the columns match)?

I tried using:

df.drop_duplicates() but it doesn’t work.

>Solution :

try this

df.drop_duplicates(inplace=True)

you have to add inplace= True

Leave a Reply