I'd like to build a running sum over a pandas dataframe. I have something like:
10/10/2012: 50, 0
10/11/2012: -10, 90
10/12/2012: 100, -5
And I would like to get:
10/10/2012: 50, 0
10/11/2012: 40, 90
10/12/2012: 140, 85
So every cell should be the sum of itself and all previous cells, how should I do this without using a loop.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…