diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2015-09-27 18:08:04 +0200 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2015-09-27 18:08:04 +0200 |
commit | 26208a21a13432e062e9b268e66a87915974d214 (patch) | |
tree | 732bf49bdf43cf71ed63e0f5d0c9dd76bb7dfa99 /numpy/core/fromnumeric.py | |
parent | e06bad5fb0dc377da54412a0d127461f21cf8553 (diff) | |
download | numpy-26208a21a13432e062e9b268e66a87915974d214.tar.gz |
DOC: Document behaviour of ravel more clearly
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 10626fe9f..10f4a98c5 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1371,7 +1371,7 @@ def trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None): def ravel(a, order='C'): - """Return a flattened array. + """Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. @@ -1415,6 +1415,7 @@ def ravel(a, order='C'): ndarray.flat : 1-D iterator over an array. ndarray.flatten : 1-D array copy of the elements of an array in row-major order. + ndarray.reshape : Change the shape of an array without changing its data. Notes ----- @@ -1425,6 +1426,9 @@ def ravel(a, order='C'): the index along the last quickest. The opposite holds for column-major, Fortran-style index ordering. + When a view is desired in as many cases as possible, ``arr.reshape(-1)`` + may be preferable. + Examples -------- It is equivalent to ``reshape(-1, order=order)``. |