drop_duplicates not working in pandas?

前端 未结 5 677
抹茶落季
抹茶落季 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:43

    I have just had this issue, and this was not the solution.

    It may be in the docs - I admittedly havent looked - and crucially this is only when dealing with date-based unique rows: the 'date' column must be formatted as such.

    If the date data is a pandas object dtype, the drop_duplicates will not work - do a pd.to_datetime first.

提交回复
热议问题