summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py26
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))