Assume I have a dataframe df with one column namely time. Now, I’d like to add a new column to the dataframe accumulated as seen below, that sums up the values from df.time for each row.
time accumulated
1 10 10
2 12 22
3 14 36
4 6 42
A quick hint would be really nice!
For these simple tasks there is usually a build-in function. Of course, knowing what the mathematical operation is called helps finding these functions. You want the cumulative sum.