I have the following dataframe:
A B
2021-05-19 07:00:00 Nan Nan
2021-05-19 07:30:00 0.00 Nan
2021-05-19 08:00:00 0.00 Nan
2021-05-19 08:30:00 0.00 Nan
2021-05-19 09:00:00 19.91 Nan
2021-05-19 09:30:00 0.11 Nan
2021-05-19 10:00:00 0.00 Nan
2021-05-19 10:30:00 22.99 Nan
2021-05-19 11:00:00 0.00 Nan
Require:
A B
2021-05-19 07:00:00 Nan 0.00
2021-05-19 07:30:00 0.00 0.00
2021-05-19 08:00:00 0.00 0.00
2021-05-19 08:30:00 0.00 0.00
2021-05-19 09:00:00 19.91 3.32
2021-05-19 09:30:00 0.11 2.78
2021-05-19 10:00:00 0.00 2.32
2021-05-19 10:30:00 22.99 5.76
2021-05-19 11:00:00 0.00 4.80
Calculation for column B:
B1 = A1
B2 = ((B1*5)+A2)/6
B3 = ((B2*5)+A3)/6
B4 = ((B3*5)+A4)/6
etc.
I have already attempted a calculation in Python with the shift function but this doesn't work, would be great if someone can help me in the right direction.