summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-05-19 08:39:15 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-05-19 08:39:15 +0000
commit7ce372cd615b1b914e4758069989831034b3b583 (patch)
tree083b0520e9e9523918f87e2b3dea8c72e8ed5089 /numpy/core/numeric.py
parentd382977b4ac76f693c29082f62fc713680473364 (diff)
downloadnumpy-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.py10
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,