Pandas Series Frequency Value Counts

For a given pandas series, returning the frequency value counts can be returned with the value_counts() method.

import pandas as pd

a = pd.Series(['E', 'E', 'B', 'C', 'B', 'D', 'E', 'B', 'E', 'A', 'E', 'B', 'C',
        'D', 'E', 'E', 'A', 'E', 'B', 'E', 'B'])

a.value_counts()
E 9 B 6 C 2 D 2 A 2 dtype: int64

The value_counts() returns can also be normalized i.e. proportion instead of counts

a.value_counts(normalize=True)
E 0.428571 B 0.285714 C 0.095238 D 0.095238 A 0.095238 dtype: float64