blosc2.log#

blosc2.log(ndarr: NDArray | NDField | C2Array | LazyExpr, /) LazyExpr#

Compute the natural logarithm, element-wise.

Parameters:

ndarr (NDArray or NDField or C2Array or LazyExpr) – The input array.

Returns:

out – A lazy expression representing the natural logarithm of the input array

Return type:

LazyExpr

References

np.log

Examples

>>> import numpy as np
>>> import blosc2
>>> values = np.array([1, 2, 3, 4, 5])
>>> ndarray = blosc2.asarray(values)
>>> result_lazy = blosc2.log(ndarray)
>>> result = result_lazy[:]
>>> print("Original values:", values)
Original values: [1 2 3 4 5]
>>> print("Logarithm (base e):", result)
Logarithm (base e): [0.         0.69314718 1.09861229 1.38629436 1.60943791]