Skip to content

Reverse a variable

Source code

Description

Reverse a variable

Usage

<Expr>$reverse()

Value

Expr

Examples

library("polars")

pl$DataFrame(list(a = 1:5))$select(pl$col("a")$reverse())
#> shape: (5, 1)
#> ┌─────┐
#> │ a   │
#> │ --- │
#> │ i32 │
#> ╞═════╡
#> │ 5   │
#> │ 4   │
#> │ 3   │
#> │ 2   │
#> │ 1   │
#> └─────┘