We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73c5e77 commit 2f5e1a5Copy full SHA for 2f5e1a5
1 file changed
examples/extensions/python/mandel.py
@@ -17,8 +17,8 @@ def mandelbrot(N,
17
m = np.zeros((N, N), dtype=np.int32)
18
19
for i in range(1, max_iter+1):
20
- z[m == 0] = z[m == 0]**2 + c[m == 0]
21
-
22
- m[np.logical_and(np.abs(z) > 2, m == 0)] = i
+ idx = m == 0
+ z[idx] = z[idx]**2 + c[idx]
+ m[np.logical_and(np.abs(z) > 2, idx)] = i
23
24
return m
0 commit comments