drop_duplicates not working in pandas?

前端 未结 5 675
抹茶落季
抹茶落季 2020-12-07 01:58

The purpose of my code is to import 2 Excel files, compare them, and print out the differences to a new Excel file.

However, after concatenating all the data, and us

5条回答
  •  不思量自难忘°
    2020-12-07 02:44

    You've got inplace=False so you're not modifying df. You want either

     df.drop_duplicates(subset=None, keep="first", inplace=True)
    

    or

     df = df.drop_duplicates(subset=None, keep="first", inplace=False)
    

提交回复
热议问题