I am trying to add a calculated running total column to a Pandas dataframe based on another column. In the example below the calculated column (Running Total) should keep a running total for the pay of the employee, and then restart with a new running total when it finishes looping through Employee A.
Input:
Employee | Pay
-----------------------
A | 1
A | 2
A | 3
B | 2
B | 3
Output:
Employee | Pay | Running Total
----------------------------------------
A | 1 | 1
A | 2 | 3
A | 3 | 6
B | 2 | 2
B | 3 | 5