tabsdata.tableframe.expr.expr.Expr.log#

Expr.log(base: float = 2.718281828459045) Expr[source]#

Calculate the logarithm to the given base.

Parameters:

base – logarithm base, defaults to e.

Example:

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