Skip to content

Index of first unique values

Source code

Description

This finds the position of first occurrence of each unique value.

Usage

<Expr>$arg_unique()

Value

Expr

Examples

library(polars)

pl$select(pl$lit(c(1:2, 1:3))$arg_unique())
#> shape: (3, 1)
#> ┌─────┐
#> │     │
#> │ --- │
#> │ u32 │
#> ╞═════╡
#> │ 0   │
#> │ 1   │
#> │ 4   │
#> └─────┘