summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-09-27 12:00:13 -0600
committerCharles Harris <charlesr.harris@gmail.com>2015-09-27 12:00:13 -0600
commit41afcc3681d250f231aea9d9f428a9e197a47f6e (patch)
treedf35615f06af0ef6ad01df98a049658b40f3741e /numpy/core/fromnumeric.py
parent5047f2d7cba7478017f73b501248ccec7ea32e1a (diff)
parent26208a21a13432e062e9b268e66a87915974d214 (diff)
downloadnumpy-41afcc3681d250f231aea9d9f428a9e197a47f6e.tar.gz
Merge pull request #6372 from seberg/revert-vdot
REV: Make sure ravel returns a contiguous array
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py6
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)``.