pandas 查看某列的值有重复值,并将这些重复值找出来
我们先知道某一列是否有重复值,并将这些重复值找出来
a = zongti.groupby('reportno').count()>1 a[a['ref_id'] == True].index #里面的列,随便一列都行
结果:
Index(['2016122100003477314271', '2017011100003543220588',
'2017012000003575254500', '2017012400003588159436',
'2017020700003607883826', '2018041300005391719350',
'2018041600005402623170', '2018042000005423149388',
'2019010900006795508613'],
dtype='object', name='reportno')
即可