summaryrefslogtreecommitdiff
path: root/numpy/core/ma.py
diff options
context:
space:
mode:
authorsasha <sasha@localhost>2006-03-05 18:11:38 +0000
committersasha <sasha@localhost>2006-03-05 18:11:38 +0000
commitfe076fbbda80b494d6b0cde4511df83bddcddfe0 (patch)
tree96608053ed3c9ad024fa0a64374c909028432acb /numpy/core/ma.py
parentd5c0229e1ac366b43bc35c9fdbf6d0f102d00539 (diff)
downloadnumpy-fe076fbbda80b494d6b0cde4511df83bddcddfe0.tar.gz
fixed ma.nonzero
Diffstat (limited to 'numpy/core/ma.py')
-rw-r--r--numpy/core/ma.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py
index 26631693b..7105a4e65 100644
--- a/numpy/core/ma.py
+++ b/numpy/core/ma.py
@@ -464,7 +464,14 @@ tanh = masked_unary_operation(umath.tanh)
absolute = masked_unary_operation(umath.absolute)
fabs = masked_unary_operation(umath.fabs)
negative = masked_unary_operation(umath.negative)
-nonzero = masked_unary_operation(oldnumeric.nonzero)
+
+def nonzero(a):
+ """returns the indices of the elements of a which are not zero and not masked
+
+ a must be 1d
+ """
+ return asarray(filled(a,0).nonzero())
+
around = masked_unary_operation(oldnumeric.round_)
floor = masked_unary_operation(umath.floor)
ceil = masked_unary_operation(umath.ceil)