Skip to content

Commit ab770f6

Browse files
committed
DOC: Update randn() to use rng.normal()
Updates all references to `randn` to use `normal` from Generator. I left the matlib versions alone. I removed all references to `seed=123` and left `# may vary`. Longer outputs were reformatted to use Jupyter style output. [skip actions] [skip azp] [skip cirrus]
1 parent e7e56da commit ab770f6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

numpy/polynomial/hermite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None):
14611461
>>> from numpy.polynomial.hermite import hermfit, hermval
14621462
>>> x = np.linspace(-10, 10)
14631463
>>> rng = np.random.default_rng()
1464-
>>> err = rng.normal(scale=1./10,size=len(x))
1464+
>>> err = rng.normal(scale=1./10, size=len(x))
14651465
>>> y = hermval(x, [1, 2, 3]) + err
14661466
>>> hermfit(x, y, 2)
14671467
array([1.02294967, 2.00016403, 2.99994614]) # may vary

numpy/polynomial/hermite_e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None):
13881388
>>> from numpy.polynomial.hermite_e import hermefit, hermeval
13891389
>>> x = np.linspace(-10, 10)
13901390
>>> rng = np.random.default_rng()
1391-
>>> err = rng.normal(scale=1./10,size=len(x))
1391+
>>> err = rng.normal(scale=1./10, size=len(x))
13921392
>>> y = hermeval(x, [1, 2, 3]) + err
13931393
>>> hermefit(x, y, 2)
13941394
array([1.02284196, 2.00032805, 2.99978457]) # may vary

numpy/polynomial/laguerre.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None):
14421442
>>> from numpy.polynomial.laguerre import lagfit, lagval
14431443
>>> x = np.linspace(0, 10)
14441444
>>> rng = np.random.default_rng()
1445-
>>> err = rng.normal(scale=1./10,size=len(x))
1445+
>>> err = rng.normal(scale=1./10, size=len(x))
14461446
>>> y = lagval(x, [1, 2, 3]) + err
14471447
>>> lagfit(x, y, 2)
14481448
array([1.00578369, 1.99417356, 2.99827656]) # may vary

0 commit comments

Comments
 (0)