dfr take for dataframe

Creates new dataframe using the given indices.

WARNING

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

Signature

> dfr take {flags} (indices)

Parameters

  • indices: list of indices used to take data

Input/output types:

inputoutput
anyany

Examples

Takes selected rows from dataframe

> let df = ([[a b]; [4 1] [5 2] [4 3]] | dfr into-df);
    let indices = ([0 2] | dfr into-df);
    $df | dfr take $indices
╭───┬───┬───╮
 # │ a │ b │
├───┼───┼───┤
 0  4  1 
 1  4  3 
╰───┴───┴───╯

Takes selected rows from series

> let series = ([4 1 5 2 4 3] | dfr into-df);
    let indices = ([0 2] | dfr into-df);
    $series | dfr take $indices
╭───┬───╮
 # │ 0 │
├───┼───┤
 0  4 
 1  5 
╰───┴───╯