python-pandas如何查看某列无重复的值

版权声明:知识无界限,大家可自由转载。 https://blog.csdn.net/xidianbaby/article/details/89089733
import pandas as pd

air = pd.read_csv("../data/sq_air.csv", dtype={'station_id': str})
print("air:{}".format(air.shape))  # air:(341, 13)

# Hash table-based unique
# Uniques are returned in order of appearance
# This does NOT sort
print(air['station_id'].unique())  # ['244002' '244003' '244001']

猜你喜欢

转载自blog.csdn.net/xidianbaby/article/details/89089733