Skip to main content
Version: 1.1.0

Expr.hash

def hash(
seed: int = 0,
seed_1: int | None = None,
seed_2: int | None = None,
seed_3: int | None = None,
) -> Expr

Categories: numeric

Compute the hash of an element value.

Parameters

parameter
seed

The seed for the hash function.

parameter
seed_1

The first seed for the hash function.

parameter
seed_2

The second seed for the hash function.

parameter
seed_3

The third seed for the hash function.

Examples

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf = tf.select(td.col("temp"), td.col("temp").hash(5).alias("hash"))
>>>
┌──────┬─────────────────────┐
│ temp ┆ hash
------
│ f64 ┆ u64 │
╞══════╪═════════════════════╡
1.11438840365631752616
2.04738789230185236462
└──────┴─────────────────────┘