pandas-定位消除重复数据

import pandas as pd
student = pd.read_excel('C:/Users/zuxia/Downloads/020/Students_Duplicates.xlsx')
#去掉数据中的重复数据
# student.drop_duplicates(subset='Name',inplace=True,keep='last')
# print(student)
#找出重复数据
dupe = student.duplicated(subset='Name')
dupe = dupe[dupe]
print(student.iloc[dupe.index])

你可能感兴趣的:(pandas数据分析)