Expr.log
methodView source ↗
def log(base: float = 2.718281828459045) -> Expr
Categories: numeric
Calculate the logarithm to the given base.
Parameters
parameter
baselogarithm 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.1 ┆ 0.09531 │
│ 2.0 ┆ 0.693147 │
│ inf ┆ inf │
│ null ┆ null │
│ NaN ┆ NaN │
└──────┴──────────┘