tabsdata.tableframe.expr.expr.Expr.hash#

Expr.hash(seed: int = 0, seed_1: int | None = None, seed_2: int | None = None, seed_3: int | None = None) Expr[source]#

Compute the hash of an element value.

Parameters:
  • seed – The seed for the hash function.

  • seed_1 – The first seed for the hash function.

  • seed_2 – The second seed for the hash function.

  • seed_3 – The third seed for the hash function.

Example:

>>> 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 │
└──────┴─────────────────────┘