![](/img/trans.png)
[英]How to remove efficiently all duplicates in dataframe or csv file in python?
[英]how to append a dataframe to existing csv file and remove the duplicates data
我認為你需要read_csv
與DataFrame.append
,然后drop_duplicates
和最后to_csv
:
pd.read_csv('file').append(df).drop_duplicates().to_csv('file')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.