Reducing Functions Supported by Categoricals

The following reducing/aggregating methods are supported by Categoricals. The NaN versions exclude NaN values.

When a method is called on a Categorical, it’s applied to each group.

Reducing Function

Description

count()

Total number of items

count_uniques()

Total number of each unique item

first(), last()

First item, last item

mean(), nanmean()

Mean, NaN version

median(), nanmedian()

Median, NaN version

min(), nanmin()

Minimum, NaN version

max(), nanmax()

Maximum, NaN version

mode()

The number that occurs most often (skips NaNs)

nth()

Take nth value, or a subset if n is a list

prod()

Product of all items

std(), nanstd()

Standard deviation, NaN version

sum(), nansum()

Sum of all items, NaN version

trimbr()

Trimmed mean br (skips NaNs)

var(), nanvar()

Variance, NaN version