Referencing the docs: "The groups attribute is a dict whose keys are the computed unique groups and corresponding values being the axis labels belonging to each group"
You may be interested in looking into .agg(), for example:
df = pd.DataFrame([['Person A', 2, 3, 4],
['Person B', 3, 2, 1],
['Person C', 5, 7, 5],
['Person A', 3, 4, 9],
['Person C', 8, 3, 2]],
columns=['Person','Val 1','Val 2','Val 3'])
Gives the following dataframe:
Person Val 1 Val 2 Val 3
0 Person A 2 3 4
1 Person B 3 2 1
2 Person C 5 7 5
3 Person A 3 4 9
4 Person C 8 3 2
Then doing a groupyby and agg:
df.groupby('Person').agg({'Val 1': 'sum', 'Val 2': 'mean', 'Val 3': 'count'})
Gives:
Val 1 Val 2 Val 3
Person
Person A 5 3.5 2
Person B 3 2.0 1
Person C 13 5.0 2
Here you can simply pass a dictionary to agg that specifies operations that you would like to perform on each group for a specific column.