polars slice for dataframe
Creates new dataframe from a slice of rows.
Signature
> polars slice {flags} (offset) (size)
Parameters
-
offset: Start of slice. -
size: Size of slice.
Input/output types:
| input | output |
|---|---|
| polars_dataframe | polars_dataframe |
| polars_lazyframe | polars_lazyframe |
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 │ ╰───┴───┴───╯
Create a new lazy dataframe from a slice of a lazy dataframe's rows
> [[a b]; [1 2] [3 4]] | polars into-lazy | polars slice 0 1 | describe polars_lazyframe
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/polars_slice.html