diff options
author | pierregm <pierregm@localhost> | 2010-08-11 01:59:39 +0000 |
---|---|---|
committer | pierregm <pierregm@localhost> | 2010-08-11 01:59:39 +0000 |
commit | 6cfb3ff7d24f87257f067359fdf0957fad8f6718 (patch) | |
tree | 14b4e7e393fe830c6c55e00199e2267a4c3f119f /numpy/ma/extras.py | |
parent | 1994e4ae0f9e98c419793c7d3e6a079aa0c23010 (diff) | |
download | numpy-6cfb3ff7d24f87257f067359fdf0957fad8f6718.tar.gz |
fix (flat)notmasked_/contiguous/edges/
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r-- | numpy/ma/extras.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 99332b1f3..5ca1e3d1b 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -273,7 +273,7 @@ class _fromnxfunction: if len(args) == 1: x = args[0] if isinstance(x, ndarray): - _d = func(np.asarray(x), **params) + _d = func(x.__array__(), **params) _m = func(getmaskarray(x), **params) return masked_array(_d, mask=_m) elif isinstance(x, tuple) or isinstance(x, list): @@ -292,12 +292,12 @@ class _fromnxfunction: res.append(masked_array(_d, mask=_m)) return res -#atleast_1d = _fromnxfunction('atleast_1d') -#atleast_2d = _fromnxfunction('atleast_2d') -#atleast_3d = _fromnxfunction('atleast_3d') -atleast_1d = np.atleast_1d -atleast_2d = np.atleast_2d -atleast_3d = np.atleast_3d +atleast_1d = _fromnxfunction('atleast_1d') +atleast_2d = _fromnxfunction('atleast_2d') +atleast_3d = _fromnxfunction('atleast_3d') +#atleast_1d = np.atleast_1d +#atleast_2d = np.atleast_2d +#atleast_3d = np.atleast_3d vstack = row_stack = _fromnxfunction('vstack') hstack = _fromnxfunction('hstack') @@ -1742,6 +1742,7 @@ def _ezclump(mask): def clump_unmasked(a): """ Return list of slices corresponding to the unmasked clumps of a 1-D array. + (A "clump" is defined as a contiguous region of the array). Parameters ---------- @@ -1758,6 +1759,11 @@ def clump_unmasked(a): ----- .. versionadded:: 1.4.0 + See Also + -------- + flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges, + notmasked_contiguous, clump_masked + Examples -------- >>> a = np.ma.masked_array(np.arange(10)) @@ -1780,6 +1786,7 @@ def clump_unmasked(a): def clump_masked(a): """ Returns a list of slices corresponding to the masked clumps of a 1-D array. + (A "clump" is defined as a contiguous region of the array). Parameters ---------- @@ -1796,6 +1803,11 @@ def clump_masked(a): ----- .. versionadded:: 1.4.0 + See Also + -------- + flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges, + notmasked_contiguous, clump_unmasked + Examples -------- >>> a = np.ma.masked_array(np.arange(10)) |