diff options
author | Kexuan Sun <me@kianasun.com> | 2019-06-15 11:42:43 -0700 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2019-06-15 21:42:43 +0300 |
commit | 8a5102bce50193ff3332396d30acbdd48ecb47ed (patch) | |
tree | a8dd88a96eb6dbb09ee8156bf841320d67298b46 | |
parent | 9f8401f7e03c35a1afbc5329d6c216c39c8b808a (diff) | |
download | numpy-8a5102bce50193ff3332396d30acbdd48ecb47ed.tar.gz |
DOC: Change random to uninitialized and unpredictable in empty and empty_like (#13771)
* DOC: Change "random" to "uninitialized" in doctests
-rw-r--r-- | numpy/core/_add_newdocs.py | 4 | ||||
-rw-r--r-- | numpy/core/multiarray.py | 4 | ||||
-rw-r--r-- | tools/refguide_check.py | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py index 0b4bf3342..5a3ec0dab 100644 --- a/numpy/core/_add_newdocs.py +++ b/numpy/core/_add_newdocs.py @@ -936,11 +936,11 @@ add_newdoc('numpy.core.multiarray', 'empty', -------- >>> np.empty([2, 2]) array([[ -9.74499359e+001, 6.69583040e-309], - [ 2.13182611e-314, 3.06959433e-309]]) #random + [ 2.13182611e-314, 3.06959433e-309]]) #uninitialized >>> np.empty([2, 2], dtype=int) array([[-1073741821, -1067949133], - [ 496041986, 19249760]]) #random + [ 496041986, 19249760]]) #uninitialized """) diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py index 118562c89..4f2c5b78e 100644 --- a/numpy/core/multiarray.py +++ b/numpy/core/multiarray.py @@ -128,11 +128,11 @@ def empty_like(prototype, dtype=None, order=None, subok=None, shape=None): -------- >>> a = ([1,2,3], [4,5,6]) # a is array-like >>> np.empty_like(a) - array([[-1073741821, -1073741821, 3], # random + array([[-1073741821, -1073741821, 3], # uninitialized [ 0, 0, -1073741821]]) >>> a = np.array([[1., 2., 3.],[4.,5.,6.]]) >>> np.empty_like(a) - array([[ -2.00000715e+000, 1.48219694e-323, -2.00000572e+000], # random + array([[ -2.00000715e+000, 1.48219694e-323, -2.00000572e+000], # uninitialized [ 4.38791518e-305, -2.00000715e+000, 4.17269252e-309]]) """ diff --git a/tools/refguide_check.py b/tools/refguide_check.py index 74dbad78b..c20807267 100644 --- a/tools/refguide_check.py +++ b/tools/refguide_check.py @@ -505,7 +505,8 @@ class Checker(doctest.OutputChecker): obj_pattern = re.compile('at 0x[0-9a-fA-F]+>') int_pattern = re.compile('^[0-9]+L?$') vanilla = doctest.OutputChecker() - rndm_markers = {'# random', '# Random', '#random', '#Random', "# may vary"} + rndm_markers = {'# random', '# Random', '#random', '#Random', "# may vary", + "# uninitialized", "#uninitialized"} stopwords = {'plt.', '.hist', '.show', '.ylim', '.subplot(', 'set_title', 'imshow', 'plt.show', '.axis(', '.plot(', '.bar(', '.title', '.ylabel', '.xlabel', 'set_ylim', 'set_xlim', |