dfr shift
for [dataframe or lazyframe](/commands/categories/dataframe or lazyframe.md)
Shifts the values by a given period.
WARNING
Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe
flag
Signature
> dfr shift {flags} (period)
Flags
--fill, -f {any}
: Expression used to fill the null values (lazy df)
Parameters
period
: shift period
Input/output types:
input | output |
---|---|
any | any |
Examples
Shifts the values by a given period
> [1 2 2 3 3] | dfr into-df | dfr shift 2 | dfr drop-nulls
╭───┬───╮
│ # │ 0 │
├───┼───┤
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 2 │
╰───┴───╯