Код: Выделить всё
(1, 0 397.44
1 12.72
2 422.40
Name: value, dtype: float64)
(2, 3 398.88
4 6.48
5 413.52
Name: value, dtype: float64)
(3, 6 398.40
7 68.40
8 18.96
9 56.64
10 406.56
Name: value, dtype: float64)
(4, 11 398.64
12 14.64
13 413.76
Name: value, dtype: float64)
...
Код: Выделить всё
(1, 0 0 #(= 397.44 - 397.44)
1 12.72 #(= 397.44 + 12.72 - 397.44)
2 435.12 #(= 397.44 + 12.72 + 422.40 - 397.44)
Код: Выделить всё
cumulative_sums = data.apply(lambda x: x.cumsum())
Код: Выделить всё
lambda x: x.cumsum()-x[0]
Подробнее здесь: https://stackoverflow.com/questions/787 ... ith-a-comm