polars.Series.shift_and_fill#

Series.shift_and_fill(fill_value: int | Expr, *, periods: int = 1) Series[source]#

Shift the values by a given period and fill the resulting null values.

Parameters:
fill_value

Fill None values with the result of this expression.

periods

Number of places to shift (may be negative).