Skip to content

[svd_intro.md] Update np.random → Generator API#1003

Open
Chihiro2000GitHub wants to merge 1 commit into
mainfrom
update-rng-svd-intro
Open

[svd_intro.md] Update np.random → Generator API#1003
Chihiro2000GitHub wants to merge 1 commit into
mainfrom
update-rng-svd-intro

Conversation

@Chihiro2000GitHub

Copy link
Copy Markdown
Contributor

Summary

This PR migrates legacy NumPy random API usage in svd_intro.md as part of QuantEcon/meta#299.

The two np.random.rand(...) calls are replaced with calls on an explicit generator rng = np.random.default_rng(), defined once in the lecture's import cell.

Related PRs and issues

I checked for open PRs and issues related to this lecture. No open PR modifies svd_intro.md, and no open issue concerns this migration.

Details

  • rng = np.random.default_rng() added to the import cell.
  • np.random.rand(5, 2)rng.random((5, 2)) and np.random.rand(2, 5)rng.random((2, 5)), in the two cells that build a random matrix X for the full-versus-reduced SVD comparison.
  • No fixed seed was introduced, since the lecture did not seed before.
  • No prose changes were needed: the text does not refer to np.random, and the discussion is about the shapes of U, S and V rather than the realized entries of X.
  • The lecture contains no Numba (@jit, @njit, @jitclass, parallel=True, prange) code.
  • A full local build completed successfully and svd_intro.md executed without errors.

Hi @mmcky and @HumphreyYang, I'd be grateful if you could take a look when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant