summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2009-04-13 11:24:40 +0000
committerpierregm <pierregm@localhost>2009-04-13 11:24:40 +0000
commit430647c0dbdde130f0747c1fa2b1939d33e8f9b6 (patch)
tree1f169859fae972a87927b907fa87b3eaeb558333 /numpy/ma/extras.py
parentd673c50ccfe30f0b97de2d853e20fdc191a3fe30 (diff)
downloadnumpy-430647c0dbdde130f0747c1fa2b1939d33e8f9b6.tar.gz
* fixed notmasked_edges when no data are masked
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index f30f73ab3..1aa43a222 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -1249,8 +1249,8 @@ mr_ = mr_class()
def flatnotmasked_edges(a):
"""
- Find the indices of the first and last not masked values in a
- 1D masked array. If all values are masked, returns None.
+ Find the indices of the first and last valid values in a 1D masked array.
+ If all values are masked, returns None.
"""
m = getmask(a)
@@ -1282,7 +1282,7 @@ def notmasked_edges(a, axis=None):
a = asarray(a)
if axis is None or a.ndim == 1:
return flatnotmasked_edges(a)
- m = getmask(a)
+ m = getmaskarray(a)
idx = array(np.indices(a.shape), mask=np.asarray([m]*a.ndim))
return [tuple([idx[i].min(axis).compressed() for i in range(a.ndim)]),
tuple([idx[i].max(axis).compressed() for i in range(a.ndim)]),]
@@ -1338,7 +1338,7 @@ def notmasked_contiguous(a, axis=None):
result = []
#
other = (axis+1)%2
- idx = [0,0]
+ idx = [0, 0]
idx[axis] = slice(None, None)
#
for i in range(a.shape[other]):