[svd_intro.md] Update np.random → Generator API#1003
Open
Chihiro2000GitHub wants to merge 1 commit into
Open
Conversation
56 tasks
📖 Netlify Preview Ready!Preview URL: https://pr-1003--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed Lectures
Build Info
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates legacy NumPy random API usage in
svd_intro.mdas part of QuantEcon/meta#299.The two
np.random.rand(...)calls are replaced with calls on an explicit generatorrng = 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))andnp.random.rand(2, 5)→rng.random((2, 5)), in the two cells that build a random matrixXfor the full-versus-reduced SVD comparison.np.random, and the discussion is about the shapes ofU,SandVrather than the realized entries ofX.@jit,@njit,@jitclass,parallel=True,prange) code.svd_intro.mdexecuted without errors.Hi @mmcky and @HumphreyYang, I'd be grateful if you could take a look when you have time.