| title | Tutorial: NumPy NDArray Interop |
|---|---|
| description | Use FrameX NDArray with NumPy ufuncs and reductions. |
| order | 5 |
| section | Tutorials |
framex.NDArray supports NumPy protocols, so many NumPy operations work directly while retaining chunked storage.
import numpy as np
import framex as fx
x = fx.array(np.random.rand(2_000_000), chunks=250_000)
y = fx.array(np.random.rand(2_000_000), chunks=250_000)z = np.sin(x) + np.log(y + 1.0)print(np.mean(z))
print(np.max(z))
print(np.std(z))mask = z > 0.5
clipped = np.where(mask, z, 0.5)as_numpy = clipped.to_numpy()Use NDArray when your workflow is mostly numeric vector transforms and you want chunk-aware behavior with an easy NumPy-facing API.