summaryrefslogtreecommitdiff
path: root/numpy/core/ma.py
diff options
context:
space:
mode:
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)