df = pd.DataFrame({'a': [1, 1, 2], 'b': [3, 4, 5]})
gb = df.groupby('a', as_index=False)['b']
result = gb.agg(["sum", "mean"])
print(result)
#    sum  mean
# a           
# 1    7   3.5
# 2    5   5.0

In the output, a should be a column rather than in the index.

Comment From: tpackard1

@rhshadrach are you working on this? If not I would like to take it.

Comment From: rhshadrach

I think this will be easier to fix after a PR I'm working on which changes how .groupby(..., as_index=False)['b'] behaves. I would recommend holding off until then (it should be up next week sometime). I'll ping you here when that's done.

Comment From: rhshadrach

The PR is #50744, but still needs some minor fixups and review.

Comment From: luke396

   a  sum  mean
0  1    7   3.5
1  2    5   5.0

For now, it looks nice in main branch.