>>> test.val.cumsum()
0 11
1 13
2 56
3 60
4 65
Name: val, dtype: int64
How do I get the original values from the cumulative sum? I will have to get [11,2,43,4,5]
>>> test.val.cumsum()
0 11
1 13
2 56
3 60
4 65
Name: val, dtype: int64
How do I get the original values from the cumulative sum? I will have to get [11,2,43,4,5]
Copyright © 2021 Jogjafile Inc.
You could use the
diff()
Series method (withfillna
to replace the first value in the series):