Skip to content

Commit 06af1a9

Browse files
Update need_for_speed to new API (#545)
Co-authored-by: Humphrey Yang <39026988+HumphreyYang@users.noreply.github.com>
1 parent 1b356ab commit 06af1a9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lectures/need_for_speed.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@ The following vectorized code uses NumPy, which we'll soon investigate in depth,
340340
to achieve the same thing.
341341

342342
```{code-cell} ipython
343+
rng = np.random.default_rng()
343344
with qe.Timer():
344-
x = np.random.uniform(0, 1, n)
345+
x = rng.uniform(0, 1, n)
345346
y = np.sum(x**2)
346347
```
347348

0 commit comments

Comments
 (0)