blosc2.log1p#
- blosc2.log1p(ndarr: NDArray | NDField | C2Array | LazyExpr, /) LazyExpr #
Return the natural logarithm of one plus the input array, element-wise.
- Parameters:
ndarr¶ (NDArray or NDField or C2Array or LazyExpr) – The input array.
- Returns:
out – A lazy expression representing the natural logarithm of one plus the input array.
- Return type:
References
Examples
>>> import numpy as np >>> import blosc2 >>> values = np.array([-0.9, -0.5, 0, 0.5, 0.9]) >>> ndarray = blosc2.asarray(values) >>> result_lazy = blosc2.log1p(ndarray) >>> result = result_lazy[:] >>> print("Original values:", values) Original values: [-0.9 -0.5 0. 0.5 0.9] >>> print("Log1p (log(1 + x)):", result) Log1p (log(1 + x)): [-2.30258509 -0.69314718 0. 0.40546511 0.64185389]