Skip to content

Hash and combine the rows in this DataFrame

Source code

Description

The hash value is of type UInt64.

Usage

<DataFrame>$hash_rows(seed = 0, seed_1 = NULL, seed_2 = NULL, seed_3 = NULL)

Arguments

seed Random seed parameter. Defaults to 0.
seed_1 Random seed parameter. Defaults to seed if not set.
seed_2 Random seed parameter. Defaults to seed if not set.
seed_3 Random seed parameter. Defaults to seed if not set.

Details

This implementation does not guarantee stable results across different Polars versions. Its stability is only guaranteed within a single version.

Value

A polars Series

Examples

library("polars")

df <- pl$DataFrame(
  foo = c(1, NA, 3, 4),
  ham = c("a", "b", NA, "d")
)
df$hash_rows(seed = 42)
#> shape: (4, 1)
#> ┌──────────────────────┐
#> │                      │
#> │ ---                  │
#> │ u64                  │
#> ╞══════════════════════╡
#> │ 11236583422053995155 │
#> │ 17641593758681851434 │
#> │ 6476636863897975030  │
#> │ 950300120623942918   │
#> └──────────────────────┘