Skip to content

Return a boolean mask indicating duplicated values

Description

Return a boolean mask indicating duplicated values

Usage

<Expr>$is_duplicated()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(a = c(1, 1, 2, 3, 2))
df$select(pl$col("a")$is_duplicated())
#> shape: (5, 1)
#> ┌───────┐
#> │ a     │
#> │ ---   │
#> │ bool  │
#> ╞═══════╡
#> │ true  │
#> │ true  │
#> │ true  │
#> │ false │
#> │ true  │
#> └───────┘