- Published on
- · Data Independent
Pandas Value Counts | pd.Series.value_counts()
This post is auto-generated from a public YouTube video for personal study notes. It is not an endorsement. The transcript is machine-derived and may contain errors; refer to the original video for accuracy.
About this video
Often when you're doing exploratory data analysis (EDA), you'll need to get a better feel for a column. One of the best ways to do this is to understand the distribution of values with you column.
This is where Pandas Value Counts comes in.
Pandas Series.value_counts() function returns a Series containing the counts (number) of unique values in your Series.
By default the resulting series will be in descending order so that the first element is the most frequent element.
Pseudo code: Take a DataFrame column (or Series) and find the distinct values. Then count how many times each distinct value occurs.