Conversation
|
Many thanks @Chihiro2000GitHub , this looks good to me. |
HumphreyYang
left a comment
There was a problem hiding this comment.
Many thanks @jstac and @Chihiro2000GitHub, just one very minor suggestion!
|
|
||
| x = np.random.randn(200) | ||
| y = 2 * x + 0.1 * np.random.randn(200) | ||
| rng = np.random.default_rng() |
There was a problem hiding this comment.
I remember the convention was to use a single rng for the main text and separate ones in solution blocks (see this PR discussion). According to that, I think we can reuse the rng on line 110 here.
|
Thanks for pointing this out, @HumphreyYang! I had missed that convention. I’ve removed the additional |
|
Thanks @Chihiro2000GitHub, @HumphreyYang and @jstac |
✅ Translation sync completed (zh-cn)Target repo: QuantEcon/lecture-python-programming.zh-cn
|
✅ Translation sync completed (fa)Target repo: QuantEcon/lecture-python-programming.fa
|
Summary
This PR updates
lectures/scipy.mdas part of the NumPy random API migration described in QuantEcon/meta#299.The changes are limited to the following:
np.random.beta(...)withrng = np.random.default_rng()/rng.beta(...)np.random.randn(...)withrng.standard_normal(...)in "12.3.3. Other Goodies in scipy.stats"np.random.randn(...)withrng.standard_normal(...)in the Monte Carlo exercise solution (Exercise 12.3)Each code block defines its own
rnglocally. The exercise solution block remains self-contained.No fixed seed is introduced, as the original lecture did not use one.
No Numba-related code was present in this file.
Hi @mmcky and @HumphreyYang, I'd be grateful if you could take a look when you have time.