I am working with pandas, but I don\'t have so much experience. I have the following DataFrame:
A 0 NaN 1 0.00 2 0.00 3 3.33 4
Check the pandas.Series.expanding. The series.expanding(min_periods=2).sum()
series.expanding(min_periods=2).sum()
will do the job for you. And don't forget to set 0-th element, since it is NaN. I mean,
NaN
accumulation = series.expanding(min_periods=2).sum() accumulation[0] = series[0] # or as you like