blosc2.sqrt#
- blosc2.sqrt(ndarr: NDArray | NDField | C2Array | LazyExpr, /) LazyExpr #
Return the non-negative square-root of an array, element-wise.
- Parameters:
ndarr¶ (NDArray or NDField or C2Array or LazyExpr) – The input array.
- Returns:
out – A lazy expression representing the square root of the input array. The result can be evaluated.
- Return type:
References
Examples
>>> import numpy as np >>> import blosc2 >>> data = np.array([0, np.pi/6, np.pi/4, np.pi/2, np.pi]) >>> nd_array = blosc2.asarray(data) >>> result_ = blosc2.sqrt(nd_array) >>> result = result_[:] >>> print("Original numbers:", data) Original numbers: [ 0 1 4 9 16 25] >>> print("Square roots:", result) Square roots: [0. 1. 2. 3. 4. 5.]