How to get frequency counts of a column in Pandas DataFrame

In this post, we will see how to get frequency counts of a column in Pandas DataFrame.

Sometimes, you might have to find counts of each unique value for the categorical column. You can use value_count() to get frequency counts easily. value_count() returns series object with frequency counts data for a column.

Here is sample Employee data that will be used in below example:

NameAgeDepartment
Adam27HR
Reena22Sales
Mahesh33Tech
Supriya26HR
Aman34Tech

Output:

As you can see, we got Frequency counts for each unique value in column Department.
That’s all about how to get frequency counts of a column in Pandas DataFrame.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *