RT,自己随便写了个,显示错误为
ValueError: Can only compare identically-labeled DataFrame objects
但总感觉思路都错了....请指教一下
import pandas as pd from pandas import DataFrame L=[] file=open('F:\\FCD\\实验文本.txt') a=file.readlines() for line in a: L.append(line.split(',')) data=pd.DataFrame(L) for i in range(len(data)): for u in range(len(data)): a=data[i:i+1] b=data[u:u+1] if u != i and a==b: data.drop(data.index[[i,i+1]],inplace=True)
largeQ