Get a slice of this expression
Description
Get a slice of this expression
Usage
<Expr>$slice(offset, length = NULL)
Arguments
offset
|
Numeric or expression, zero-indexed. Indicates where to start the slice. A negative value is one-indexed and starts from the end. |
length
|
Maximum number of elements contained in the slice. If NULL
(default), all rows starting at the offset will be selected.
|
Value
A polars expression
Examples
#> shape: (6, 1)
#> ┌─────┐
#> │ a │
#> │ --- │
#> │ i32 │
#> ╞═════╡
#> │ 0 │
#> │ 1 │
#> │ 2 │
#> │ 3 │
#> │ 4 │
#> │ 5 │
#> └─────┘
#> shape: (6, 1)
#> ┌─────┐
#> │ a │
#> │ --- │
#> │ i32 │
#> ╞═════╡
#> │ 95 │
#> │ 96 │
#> │ 97 │
#> │ 98 │
#> │ 99 │
#> │ 100 │
#> └─────┘
#> shape: (21, 1)
#> ┌─────┐
#> │ a │
#> │ --- │
#> │ i32 │
#> ╞═════╡
#> │ 80 │
#> │ 81 │
#> │ 82 │
#> │ 83 │
#> │ 84 │
#> │ … │
#> │ 96 │
#> │ 97 │
#> │ 98 │
#> │ 99 │
#> │ 100 │
#> └─────┘