Skip to content

Commit e60cf3b

Browse files
Update rng usage in eigen_I.md (#735)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 99fbdbf commit e60cf3b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lectures/eigen_I.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,8 @@ A = np.array([[1, 0, 3],
10051005
num_iters = 20
10061006
10071007
# Define a random starting vector b
1008-
b = np.random.rand(A.shape[1])
1008+
rng = np.random.default_rng()
1009+
b = rng.random(A.shape[1])
10091010
10101011
# Get the leading eigenvector of matrix A
10111012
eigenvector = np.linalg.eig(A)[1][:, 0]

0 commit comments

Comments
 (0)