polars.Expr.shift

Expr.shift(periods: int = 1) polars.internals.expr.Expr

Shift the values by a given period and fill the parts that will be empty due to this operation with nulls.

Parameters
periods

Number of places to shift (may be negative).