polars slice
for dataframe
Creates new dataframe from a slice of rows.
This command requires a plugin
The polars slice
command resides in the polars
plugin. To use this command, you must install and register nu_plugin_polars
. See the Plugins chapter in the book for more information.
Signature
> polars slice {flags} (offset) (size)
Parameters
offset
: start of slicesize
: size of slice
Input/output types:
input | output |
---|---|
any | any |
Examples
Create new dataframe from a slice of the rows
> [[a b]; [1 2] [3 4]] | polars into-df | polars slice 0 1
╭───┬───┬───╮
│ # │ a │ b │
├───┼───┼───┤
│ 0 │ 1 │ 2 │
╰───┴───┴───╯