For a variable 'length', I need to do this:
y = some constant
df['result'] = sum(
df['value'].shift(0) * y * 0,
df['value'].shift(1) * y * 1,
...,
df['value'].shift(length-1) * y * (length-1)
)
and fill every row like this.
I know how to do it iteratively and it will be super slow. How to do this as a vector operation?