blosc2.cosh#

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

Compute the hyperbolic cosine, element-wise.

Parameters:

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

Returns:

out – A lazy expression representing the hyperbolic cosine of the input array. The result can be evaluated.

Return type:

LazyExpr

References

np.cosh

Examples

>>> import numpy as np
>>> import blosc2
>>> numbers = np.array([-2, -1, 0, 1, 2])
>>> ndarray = blosc2.asarray(numbers)
>>> result_lazy = blosc2.cosh(ndarray)
>>> result = result_lazy[:]
>>> print("Original numbers:", numbers)
Original numbers: [-2 -1  0  1  2]
>>> print("Hyperbolic cosine:", result)
Hyperbolic cosine: [3.76219569 1.54308063 1.         1.54308063 3.76219569]