W3cubDocs

/Nushell

dfr rolling for dataframe

Rolling calculation for a series.

Signature

> dfr rolling {flags} (type) (window)

Parameters

  • type: rolling operation
  • window: Window size for rolling

Input/output types:

input output
any any

Examples

Rolling sum for a series

> [12345] |dfr into-df|dfr rollingsum2|dfr drop-nulls
╭───┬───────────────╮
# │ 0_rolling_sum │
├───┼───────────────┤
03
15
27
39
╰───┴───────────────╯

Rolling max for a series

> [12345] |dfr into-df|dfr rollingmax2|dfr drop-nulls
╭───┬───────────────╮
# │ 0_rolling_max │
├───┼───────────────┤
02
13
24
35
╰───┴───────────────╯

Tips: Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe flag

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/dfr_rolling.html