We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6db5c4e commit e6d602bCopy full SHA for e6d602b
examples/ndarray/xarray-expression.py
@@ -44,7 +44,11 @@ def __len__(self):
44
assert isinstance(b, blosc2.Array) # any Array compliant object works
45
c = blosc2.asarray(a) # convert into a blosc2.NDArray; data is copied
46
d = blosc2.SimpleProxy(a) # SimpleProxy conversion; no copies
47
+# Define a lazy expression (defer computation until needed)
48
lb = blosc2.lazyexpr("a + sin(b) + hypot(c, d) + 1")
49
50
# Check!
51
np.testing.assert_array_equal(lb[:], res)
52
+# One can also evaluate the expression directly (eager computation)
53
+resb2 = blosc2.evaluate("a + sin(b) + hypot(c, d) + 1")
54
+np.testing.assert_array_equal(resb2, res)
0 commit comments