Expr.hash
methodView source ↗
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
seedThe seed for the hash function.
parameter
seed_1The first seed for the hash function.
parameter
seed_2The second seed for the hash function.
parameter
seed_3The 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.1 ┆ 1438840365631752616 │
│ 2.0 ┆ 4738789230185236462 │
└──────┴─────────────────────┘