pandas|pandas 去重

'''处理我们重复得数据''' data=https://www.it610.com/article/pd.DataFrame({'k1':['one','two']*3,'k2':[1,1,3,3,4,4]}) data['v1']=range(6) print(data) print(data.drop_duplicates(['k1','k2'],keep='last')) #保留后面的一条数据

    推荐阅读