0 votes
in Python Pandas by
How to get frequency counts of unique items of a series?

1 Answer

0 votes
by

We can calculate the frequency counts of each unique value p as below example:

import pandas as pd

import numpy as np

p= pd.Series(np.take(list(‘pqrstu’), np.random.randint(6, size=17)))

p = pd.Series(np.take(list(‘pqrstu’), np.random.randint(6, size=17)))

value_counts()

Output:

s    4

r    4

q    3

p    3

u    3

...