how to find number of categories in python code example
Example: how to find number of categories in python
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})