生成数据
import pandas as pd
import numpy as np
df = pd.DataFrame(data=np.random.randint(0,3,20).reshape((10,2)),columns=['a','b'])
去重操作
#--方法1
print df[~df.duplicated()]
#--方法2
print df.drop_duplicates()
重复数据
print df[df.duplicated()]
import pandas as pd
import numpy as np
df = pd.DataFrame(data=np.random.randint(0,3,20).reshape((10,2)),columns=['a','b'])
#--方法1
print df[~df.duplicated()]
#--方法2
print df.drop_duplicates()
print df[df.duplicated()]