summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorLaura Martens <laura.d.martens@icloud.com>2021-05-12 12:35:14 +0200
committerGitHub <noreply@github.com>2021-05-12 12:35:14 +0200
commitbb745921ac6c27d6caf9b76663668e5b9f28abac (patch)
treecb2e74269770ba9fcd6936ded25e9d2dceda75b1 /numpy/ma/extras.py
parentfb586a4f5760efaae57a9251ed98c4ebd3edcdf8 (diff)
downloadnumpy-bb745921ac6c27d6caf9b76663668e5b9f28abac.tar.gz
BUG: fixed ma.average ignoring masked weights (#18960)
Closes #10438 Co-authored-by: mecopur <mecopur@outlook.com>
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 8c123bc3b..bd5fc2ca3 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -614,7 +614,7 @@ def average(a, axis=None, weights=None, returned=False):
"Length of weights not compatible with specified axis.")
# setup wgt to broadcast along axis
- wgt = np.broadcast_to(wgt, (a.ndim-1)*(1,) + wgt.shape)
+ wgt = np.broadcast_to(wgt, (a.ndim-1)*(1,) + wgt.shape, subok=True)
wgt = wgt.swapaxes(-1, axis)
if m is not nomask: