pandas 筛选去除重复的数据

import pandas as pd
data={'demo':[1,1,2,2,1,2,2,3,4,5,6,98,4,2,4,5,2,5,6,7]}
df=pd.DataFrame(data)

a=df.drop_duplicates(subset=['demo'],keep='first')
print(a)

 

pandas 筛选去除重复的数据_第1张图片

你可能感兴趣的:(pandas)