Let's say we have a dataframe like this:
Time = ['00:01', '00:02','00:03','00:04','00:05','00:06','00:07','00:08','00:09']
Value = [2.5, 3.2, 4.6, 3.6, 1.5, 2.5, 0.4, 5.7, 1.5]
df = pd.DataFrame({'Time':Time, 'Value':Value})
For simplicity we will just calculate the average of the row itself, the row prior and the row posterior. So I would be looking for this result:
df
Time Value
00:01 2.85
00:02 3.43
00:03 3.8
00:04 3.23
00:05 2.53
00:06 1.47
00:07 2.87
00:08 2.53
00:09 3.6
Any help would be greatly appreciated.