Expr.sub
methodView source ↗
def sub(other: Any) -> TdExpr
Categories: numeric
Equivalent to the - operator.
Parameters
parameter
othervalue to subtract.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("val"), td.col("val").sub(1).alias("sub"))
>>>
┌──────┬──────────┐
│ val ┆ sub │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞══════╪══════════╡
│ 1 ┆ 0 │
│ 15 ┆ 14 │
│ 18 ┆ 17 │
│ 60 ┆ 59 │
│ 60 ┆ 59 │
│ 75 ┆ 74 │
│ null ┆ null │
└──────┴──────────┘