Expr.neg
methodView source ↗
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.0 ┆ 1.0 │
│ 0.0 ┆ -0.0 │
│ 1.1 ┆ -1.1 │
│ 2.0 ┆ -2.0 │
│ inf ┆ -inf │
│ null ┆ null │
│ NaN ┆ NaN │
└──────┴──────┘