polars.Series.rolling_min#
- Series.rolling_min(
- window_size: int,
- weights: list[float] | None = None,
- *,
- min_periods: int | None = None,
- center: bool = False,
Apply a rolling min (moving min) over the values in this array.
Warning
This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.
A window of length
window_size
will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by theweight
vector. The resulting values will be aggregated to their min.The window at a given row will include the row itself and the
window_size - 1
elements before it.- Parameters:
- window_size
The length of the window in number of elements.
- weights
An optional slice with the same length as the window that will be multiplied elementwise with the values in the window.
- min_periods
The number of values in the window that should be non-null before computing a result. If set to
None
(default), it will be set equal towindow_size
.- center
Set the labels at the center of the window.
Examples
>>> s = pl.Series("a", [100, 200, 300, 400, 500]) >>> s.rolling_min(window_size=3) shape: (5,) Series: 'a' [i64] [ null null 100 200 300 ]