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)

Arguments

seed Random seed parameter. Defaults to 0.

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                  │
#> ╞══════════════════════╡
#> │ 3809794638032017622  │
#> │ 7555118377300582641  │
#> │ 13881508424296595263 │
#> │ 699753878888867193   │
#> └──────────────────────┘