使用pandas
df = pd.read_csv(file_path, sep=' ', header=None) a = df.drop_duplicates(subset=[0], keep='first') b = df.drop_duplicates(subset=[0], keep=False) f = a.append(b).drop_duplicates(subset=[0], keep=False)
其中,f就是重复数据的DateFtrame,之后便可以使用了
使用pandas
df = pd.read_csv(file_path, sep=' ', header=None) a = df.drop_duplicates(subset=[0], keep='first') b = df.drop_duplicates(subset=[0], keep=False) f = a.append(b).drop_duplicates(subset=[0], keep=False)
其中,f就是重复数据的DateFtrame,之后便可以使用了