After:
- aggregating with
sum() - grouping by
['country', 'match_id'] - creating a mean column with
mean(axis=1)
I ended up with this:
Gls Ast avg_attack
sum sum
country match_id
Argentina 20eb96e2 0.10 0.20 0.15
18eb43e2 0.20 0.30 0.25
...
Now, how do I flatten my dataframe back to this?
country match_id Gls Ast avg_attack
Argentina 20eb96e2 0.10 0.20 0.15
Argentina 18eb43e2 0.20 0.30 0.25