📜  如何在python代码示例中查找类别数

📅  最后修改于: 2022-03-11 14:46:56.682000             🧑  作者: Mango

代码示例1
from collections import Counter
df = pd.DataFrame({'a':['apple','apple','banana','peach', 'banana', 'apple']})

print Counter(df['a'])
>> Counter({'apple': 3, 'banana': 2, 'peach': 1})