I have a df like this one:
player_profile category upgrade_n level
0 Weak common_caddie 1 13.0
1 Weak common_caddie 1 25.0
2 Weak common_caddie 1 36.0
3 Weak common_caddie 1 51.0
4 Weak common_caddie 1 59.0
9 Standard Player common_caddie 1 18.0
10 Standard Player common_caddie 1 36.0
11 Standard Player common_caddie 1 48.0
What I need a is cumulative by player_profile and category, but I need to keep the level column. the final output should look like this:
player_profile category cumulative_sum level
Weak common_caddie 1 13
Weak common_caddie 2 25
Weak common_caddie 3 36
Weak common_caddie 4 51
Weak common_caddie 5 59
Standard Player common_caddie 1 13
Standard Player common_caddie 2 36
Standard Player common_caddie 3 48
I found this post but I couldn't achieve wht I wanted (the level colum was missing).
Thanks everyone for the help!