import pandas as pd
import numpy as np
csv2_5 = pd.read_csv('2.5++.csv')
csv3_0 = pd.read_csv('3.0++.csv')
# print(csv2_5)
#取差集 在csv3_0中但不在csv2_5中
# 合并数据集
# csv3_0 = csv3_0.append(csv2_5)
csv3_0 = pd.concat([csv3_0, csv2_5], axis=0, ignore_index=True).sample(frac=1)
second_anno = csv3_0.drop_duplicates(['filename', 'label'],keep=False)
print(second_anno.shape)
second_anno.to_csv('second_anno.csv', index=False)
求两个dataframe的差集
最新推荐文章于 2024-07-05 03:20:50 发布