How to do cumulative sum on lagged values in python?
I have come across problem of creating lagged variables, and especially their cumulative sums in python.
Lets say we have:
s=pd.DataFrame({'a':[5,4,3,2,1], 'b':[50,40,30,20,10]},index=[1,2,3,4,5]...