size of each group pd groupby code example Example: pandas get size of each group # returns number of rows in each group as a Series df_group.size()