简体   繁体   中英

Why doesn't pandas drop_duplicates() seem to work for me?

I have a dataframe with one text column. It has duplicate elements in different rows. I want to eliminate the duplicates. I use df.drop_duplicates(..., inplace=True) but it doesn't seem to work.

How do I solve this?

The issue over here was because i was modifying the dataframe on itself. Storing the modified data in another dataset, solved the purpose.

What I was doing:
    df.drop_duplicates()

What had to be done:
    df1=df.drop_duplicates()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM