Counts

value_counts() counts the number of occurrences of each value in a column, sorted by descending frequency. The normalize=True option gives proportions and dropna=False also counts missing values. It offers a quick overview of the distribution of a categorical variable.

Example

df['pays'].value_counts(normalize=True)

Related concepts

The whole glossary