tabsdata.tableframe.expr.expr.Expr.neg#

Expr.neg() Expr[source]#

Unary minus operator.

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf = tf.select(td.col("val"), td.col("val").neg().alias("neg"))
>>>
┌──────┬──────┐
│ val  ┆ neg  │
│ ---  ┆ ---  │
│ f64  ┆ f64  │
╞══════╪══════╡
│ -1.0 ┆ 1.0  │
│ 0.0  ┆ -0.0 │
│ 1.1  ┆ -1.1 │
│ 2.0  ┆ -2.0 │
│ inf  ┆ -inf │
│ null ┆ null │
│ NaN  ┆ NaN  │
└──────┴──────┘