Skip to content

Get unique values

Source code

Description

Get unique values

Usage

<Expr>$unique(maintain_order = FALSE)

Arguments

maintain_order If TRUE, the unique values are returned in order of appearance.

Value

Expr

Examples

library("polars")

as_polars_df(iris)$select(pl$col("Species")$unique())
#> shape: (3, 1)
#> ┌────────────┐
#> │ Species    │
#> │ ---        │
#> │ cat        │
#> ╞════════════╡
#> │ setosa     │
#> │ versicolor │
#> │ virginica  │
#> └────────────┘