tabsdata.tableframe.expr.expr.Expr.sub#

Expr.sub(other: Any) Expr[source]#

Equivalent to the - operator.

Parameters:

other – value to subtract.

Example:

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