GroupBy.agg()
previous
pandas.core.groupby.GroupBy.apply
next
pandas.core.groupby.SeriesGroupBy.aggregate