pandas count all values in column code example
Example 1: pandas count all values in whole dataframe
df.stack().value_counts()
Example 2: pandas count values by column
df = pd.DataFrame({'a':list('abssbab')})
df.groupby('a').count()
df.stack().value_counts()
df = pd.DataFrame({'a':list('abssbab')})
df.groupby('a').count()