I was looking at the answers here: Group by, having in pandas
The problem is, the second answer doesn't work if you do something like
homeruns = df(data['hr'].groupby([data['year'], data['team_id']]).mean())
because homeruns will be a series.
So what should the best workaround be for this situation?