Skip to main content
Version: 0.9.3

Expr.neg

def neg() -> Expr

Categories: numeric

Unary minus operator.

Examples

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