dfr take
for dataframe> dfr take {flags} (indices)
indices
: list of indices used to take datainput | output |
---|---|
any | any |
Takes selected rows from dataframe
>letdf= ([[ab]; [41] [52] [43]] |dfr into-df);
letindices= ([02] |dfr into-df);
$df|dfr take$indices
╭───┬───┬───╮
│# │ a │ b │
├───┼───┼───┤
│0│4│1│
│1│4│3│
╰───┴───┴───╯
Takes selected rows from series
>letseries= ([415243] |dfr into-df);
letindices= ([02] |dfr into-df);
$series|dfr take$indices
╭───┬───╮
│# │ 0 │
├───┼───┤
│0│4│
│1│5│
╰───┴───╯
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_take.html