希望获得数据帧的连续滚动平均值。
df 看起来像这样
index price
0 4
1 6
2 10
3 12
Run Code Online (Sandbox Code Playgroud)
希望获得持续的价格滚动
目标是让它看起来是所有价格的移动平均值。
index price mean
0 4 4
1 6 5
2 10 6.67
3 12 8
Run Code Online (Sandbox Code Playgroud)
先感谢您!