diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2018-10-31 16:53:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-31 16:53:02 -0700 |
commit | de07f5b034164e6ffcf7c79ea205c6b45400214f (patch) | |
tree | 6082798c05ce802feef7460ee7b85309bfebd4f9 /numpy/core/numeric.py | |
parent | 95998ca8241977be4fc2e424da33596c4227dab3 (diff) | |
parent | 7f48bb921863b2d1a64f511f0d8f05a1590b2b2a (diff) | |
download | numpy-de07f5b034164e6ffcf7c79ea205c6b45400214f.tar.gz |
Merge pull request #12302 from teoliphant/update-asfortranarray-docstring
DOC: Update the docstring of asfortranarray and ascontiguousarray
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 5d82bbd8d..265c3636f 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -587,7 +587,7 @@ def asanyarray(a, dtype=None, order=None): def ascontiguousarray(a, dtype=None): """ - Return a contiguous array in memory (C order). + Return a contiguous array (ndim >= 1) in memory (C order). Parameters ---------- @@ -618,13 +618,16 @@ def ascontiguousarray(a, dtype=None): >>> x.flags['C_CONTIGUOUS'] True + Note: This function returns an array with at least one-dimension (1-d) + so it will not preserve 0-d arrays. + """ return array(a, dtype, copy=False, order='C', ndmin=1) def asfortranarray(a, dtype=None): """ - Return an array laid out in Fortran order in memory. + Return an array (ndim >= 1) laid out in Fortran order in memory. Parameters ---------- @@ -655,6 +658,9 @@ def asfortranarray(a, dtype=None): >>> y.flags['F_CONTIGUOUS'] True + Note: This function returns an array with at least one-dimension (1-d) + so it will not preserve 0-d arrays. + """ return array(a, dtype, copy=False, order='F', ndmin=1) |