values count df code example
Example 1: pandas count values by column
df = pd.DataFrame({'a':list('abssbab')})
df.groupby('a').count()
Example 2: relativefrequencies of the unique values pandas
df.value_counts(normalize=True)
df = pd.DataFrame({'a':list('abssbab')})
df.groupby('a').count()
df.value_counts(normalize=True)