summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2022-07-20 09:23:32 +0300
committermattip <matti.picus@gmail.com>2022-07-20 09:23:32 +0300
commit3321bc59ca5e47a8d8677fa4d1a9af37d570a835 (patch)
treed0ed14a876a9ab2e2502f6cc0cbfd2ef57deb778 /numpy/ma/extras.py
parent57d9f0ac15932aabe6c80788c3f9c1147a0acc88 (diff)
downloadnumpy-3321bc59ca5e47a8d8677fa4d1a9af37d570a835.tar.gz
Revert "ENH: Adding __array_ufunc__ capability to MaskedArrays."
This reverts commit 8cd6f4ca00b6e0da3833fc267d50067b2ddbc069.
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 911135505..b7ff1adbc 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -588,8 +588,8 @@ def average(a, axis=None, weights=None, returned=False, *,
>>> avg, sumweights = np.ma.average(x, axis=0, weights=[1, 2, 3],
... returned=True)
>>> avg
- masked_array(data=[2.66666667, 3.66666667],
- mask=False,
+ masked_array(data=[2.6666666666666665, 3.6666666666666665],
+ mask=[False, False],
fill_value=1e+20)
With ``keepdims=True``, the following result has shape (3, 1).
@@ -2019,15 +2019,8 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False):
not_m = ~m
if w is not None:
w = w[not_m]
- x = x[not_m]
- y = y[not_m]
-
- # Only pass the ndarray data
- if w is not None:
- w = w.view(np.ndarray)
- x = x.view(np.ndarray)
- y = y.view(np.ndarray)
-
- return np.polyfit(x, y, deg, rcond, full, w, cov)
+ return np.polyfit(x[not_m], y[not_m], deg, rcond, full, w, cov)
+ else:
+ return np.polyfit(x, y, deg, rcond, full, w, cov)
polyfit.__doc__ = ma.doc_note(np.polyfit.__doc__, polyfit.__doc__)