Skip to content

Commit 061856c

Browse files
Update rng usage in about_py.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e3ddd3a commit 061856c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lectures/about_py.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ Here's some example code that generates and plots a random graph, with node colo
464464
```{code-cell} ipython
465465
import networkx as nx
466466
import matplotlib.pyplot as plt
467-
np.random.seed(1234)
467+
rng = np.random.default_rng(1234)
468468
469469
# Generate a random graph
470-
p = dict((i, (np.random.uniform(0, 1), np.random.uniform(0, 1)))
470+
p = dict((i, (rng.uniform(0, 1), rng.uniform(0, 1)))
471471
for i in range(200))
472472
g = nx.random_geometric_graph(200, 0.12, pos=p)
473473
pos = nx.get_node_attributes(g, 'pos')

0 commit comments

Comments
 (0)