W3cubDocs

/Nushell

dfr set-with-idx for dataframe

Sets value in the given index.

Signature

> dfr set-with-idx {flags} (value)

Flags

  • --indices, -i {any}: list of indices indicating where to set the value

Parameters

  • value: value to be inserted in series

Input/output types:

input output
any any

Examples

Set value in selected rows from series

>letseries= ([415243] |dfr into-df);
letindices= ([02] |dfr into-df);
$series|dfr set-with-idx6-i$indices
╭───┬───╮
# │ 0 │
├───┼───┤
06
11
26
32
44
53
╰───┴───╯

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-with-idx.html