W3cubDocs

/Nushell

dfr set for dataframe

Sets value where given mask is true.

Signature

> dfr set {flags} (value)

Flags

  • --mask, -m {any}: mask indicating insertions

Parameters

  • value: value to be inserted in series

Input/output types:

input output
any any

Examples

Shifts the values by a given period

>lets= ([12233] |dfr into-df|dfr shift2);
letmask= ($s|dfr is-null);
$s|dfr set0--mask$mask
╭───┬───╮
# │ 0 │
├───┼───┤
00
10
21
32
42
╰───┴───╯

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_set.html