Skip to content

[need_for_speed.md] Update np.random → Generator API#545

Open
Chihiro2000GitHub wants to merge 1 commit intomainfrom
update-need-for-speed-rng
Open

[need_for_speed.md] Update np.random → Generator API#545
Chihiro2000GitHub wants to merge 1 commit intomainfrom
update-need-for-speed-rng

Conversation

@Chihiro2000GitHub
Copy link
Copy Markdown
Collaborator

This PR updates lectures/need_for_speed.md as part of the NumPy random API migration described in QuantEcon/meta#299.

The change is limited to one remaining legacy NumPy random API usage in the vectorized NumPy example ("9.4.2. Vectorization vs pure Python loops").

The rng generator is initialized outside the with qe.Timer(): block, so the timing comparison continues to measure only the vectorized NumPy operation itself.

I also checked the rendered lecture with a local build. The relative timing difference between the non-vectorized Python loop and the vectorized NumPy version remains essentially unchanged, so the speed comparison in the lecture is not affected by this update.

@HumphreyYang, I'd be grateful if you could take a look when you have time!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

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