diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-05-19 08:39:15 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-05-19 08:39:15 +0000 |
commit | 7ce372cd615b1b914e4758069989831034b3b583 (patch) | |
tree | 083b0520e9e9523918f87e2b3dea8c72e8ed5089 /numpy/core/numeric.py | |
parent | d382977b4ac76f693c29082f62fc713680473364 (diff) | |
download | numpy-7ce372cd615b1b914e4758069989831034b3b583.tar.gz |
Simplify argwhere (maybe prematurely added), and fix memory leak in #125
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 5dbd1c232..6489be17a 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -134,15 +134,7 @@ def argwhere(a): is a sequence of indices into a. This sequence must be converted to a tuple in order to be used to index into a. """ - if a.ndim == 0: - return array([],dtype=intp) - else: - b = a.nonzero() - retarr = empty((b[0].shape[0],a.ndim),dtype=intp) - for k in xrange(a.ndim): - retarr[:,k] = b[k] - return retarr - + return transpose(a.nonzero()) _mode_from_name_dict = {'v': 0, 's' : 1, |