I am trying to do a simple rolling multiplication of a dataframe (each new value should be the product of all the input values in the window). Realizing that rolling does not allow of products, I tried to look for alternate solutions but they seem not to work with variable lenghth windows :
start_date = '2024-05-01'
date_index = pd.date_range(end=start_date, periods=15, freq='B')
df = pd.DataFrame(list(range(1,16)), index = date_index, columns=['A'])
df.rolling('1W').agg({"A": "prod"})
This return the error : ValueError: <Week: weekday=6> is a non-fixed frequency
Is there any clean workarround for that type of rolling ?