Python Pandas rolling functions

后端 未结 2 1466
灰色年华
灰色年华 2021-01-15 02:35

I am not sure I understand the parameter min_periods in Pandas rolling functions : why does it have to be smaller than the window para

2条回答
  •  余生分开走
    2021-01-15 03:23

    The min period argument is just a way to apply the function to a smaller sample than the rolling window. So let say you want the rolling minimum of window of 10, passing the min period argument of 5 would allow to calculate the min of the first 5 data, then the first 6, then 7,8,9 and finally 10. Now that pandas can start rolling his 10 data point windows, because it has more than 10 data point, it will keep period window of 10.

提交回复
热议问题