Expr.truediv
methodView source ↗
def truediv(other: Any) -> Expr
Categories: numeric
Equivalent to the float / operator.
Parameters
parameter
othervalue to divide by.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("val"), td.col("val").truediv(3).alias("truediv"))
>>>
┌────────┬────────────┐
│ val ┆ truediv │
│ --- ┆ --- │
│ f64 ┆ f64 │
╞════════╪════════════╡
│ 0.0123 ┆ 0.0041 │
│ 2.0244 ┆ 0.6748 │
│ 0.0 ┆ 0.0 │
│ inf ┆ inf │
│ -50.0 ┆ -16.666667 │
│ 1.0 ┆ 0.333333 │
│ NaN ┆ NaN │
│ null ┆ null │
│ -112.0 ┆ -37.333333 │
│ 2142.0 ┆ 714.0 │
└────────┴────────────┘