I have an array
arr = [1,2,3, ..., N]
and a list of windows (of length N)
windows = [2,2,1, ...]
Is it possible to do a rolling sum computation on arr
with the time varying windows stored in windows
?
For example at t=3, you have arr=[1,2,3]
and window=1
so this would indicate returning a 1 day rolling sum such that out[2] = 3
At t=2
, you have arr = [1,2]
and window=2 so this would indicate a 2 day rolling sum such that out[1]=3