nushell/docs/commands/dfr_take.md
Justin Ma c0a1d18e3d
update #4455, regenerate commands' docs and update make_docs script (#4586)
* feat: update #4455, regenerate commands' docs

* chore: update make_docs script
2022-02-21 11:26:00 -06:00

553 B

title layout version
dfr take command 0.59.0

Creates new dataframe using the given indices

Signature

> dfr take (indices)

Parameters

  • indices: list of indices used to take data

Examples

Takes selected rows from dataframe

> let df = ([[a b]; [4 1] [5 2] [4 3]] | dfr to-df);
    let indices = ([0 2] | dfr to-df);
    $df | dfr take $indices

Takes selected rows from series

> let series = ([4 1 5 2 4 3] | dfr to-df);
    let indices = ([0 2] | dfr to-df);
    $series | dfr take $indices