Running Sales Total
days has columns day and sales. Return a list where item *i* is the sum of the sales of rows 0 up to i (the running total), in row order.
Example 1
days {"day":[1,2,3,4],"sales":[5,3,0,2]}
returns [5,8,8,10]
5, 8, 8, 10.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Sorted Unique ValuesBeginner
- Swap the LabelsBeginner
- Table ShapeBeginner
- Top ScoresBeginner
- Upper QuartileBeginner
- Wanted StatusesBeginner
- Add Total ColumnEasy
- All Emails OnceEasy