Skip to main content
Version: 1.9.1

Expr.log

def log(base: float = 2.718281828459045) -> Expr

Categories: numeric

Calculate the logarithm to the given base.

Parameters

parameter
base

logarithm base, defaults to e.

Examples

>>> 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.10.09531
2.00.693147
│ inf ┆ inf │
│ null ┆ null │
│ NaN ┆ NaN │
└──────┴──────────┘