import pandas as pd #生成数据 data1,data2,data3,data4=['a',3],['b',2],['a',3],['c',2] df=pd.DataFrame([data1,data2,data3,data4],columns=['col1','col2']) print(df) col1 col2 0 a 3 1 b 2 2 a 3 3 c 2 #判断数据 isDuplicated=df.duplicated() #判断重复数据记录 print(isDupl