diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-02-22 01:46:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 01:46:28 -0800 |
commit | 8db6698657e1294c6c79db39b19c94b19cfe8c08 (patch) | |
tree | bb331800dbe2799ea404d8303b4610fdb140b5b0 /numpy/core/numeric.py | |
parent | 173a9e3eb37826e2524f5dd66aab24fcf203068b (diff) | |
parent | 579034a0c925ee9db5157141d73209beca037aeb (diff) | |
download | numpy-8db6698657e1294c6c79db39b19c94b19cfe8c08.tar.gz |
Merge pull request #10599 from girving/flatnonzero
ENH: Make flatnonzero call asanyarray before ravel()
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 123bff2ec..5c8951474 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -829,12 +829,12 @@ def flatnonzero(a): """ Return indices that are non-zero in the flattened version of a. - This is equivalent to a.ravel().nonzero()[0]. + This is equivalent to np.nonzero(np.ravel(a))[0]. Parameters ---------- - a : ndarray - Input array. + a : array_like + Input data. Returns ------- @@ -862,7 +862,7 @@ def flatnonzero(a): array([-2, -1, 1, 2]) """ - return a.ravel().nonzero()[0] + return np.nonzero(np.ravel(a))[0] _mode_from_name_dict = {'v': 0, |