polars.Series.shift_and_fill#

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

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

Parameters:
periods

Number of places to shift (may be negative).

fill_value

Fill None values with the result of this expression.