unique(): 以数组形式(numpy.ndarray)返回列的所有唯一值
nunique(): 返回唯一值的个数
测试代码:
import pandas as pd
poke_data = pd.read_csv(r'res\pokemon.csv')
t1 = poke_data['Type 1'].unique()
# 输出 numpy.ndarray
type(t1)
t2 = poke_data['Type 1'].nunique()
# 输出 int
type(t2)
输出: