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.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 1bf03e966..c139f4640 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -33,7 +33,6 @@ from .core import (
import numpy as np
from numpy import ndarray, array as nxarray
-import numpy.core.umath as umath
from numpy.core.multiarray import normalize_axis_index
from numpy.core.numeric import normalize_axis_tuple
from numpy.lib.function_base import _ureduce
@@ -614,7 +613,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:
@@ -1217,7 +1216,7 @@ def union1d(ar1, ar2):
The output is always a masked array. See `numpy.union1d` for more details.
- See also
+ See Also
--------
numpy.union1d : Equivalent function for ndarrays.
@@ -1322,7 +1321,7 @@ def cov(x, y=None, rowvar=True, bias=False, allow_masked=True, ddof=None):
observation of all those variables. Also see `rowvar` below.
y : array_like, optional
An additional set of variables and observations. `y` has the same
- form as `x`.
+ shape as `x`.
rowvar : bool, optional
If `rowvar` is True (default), then each row represents a
variable, with observations in the columns. Otherwise, the relationship
@@ -1483,7 +1482,7 @@ class MAxisConcatenator(AxisConcatenator):
# deprecate that class. In preparation, we use the unmasked version
# to construct the matrix (with copy=False for backwards compatibility
# with the .view)
- data = super(MAxisConcatenator, cls).makemat(arr.data, copy=False)
+ data = super().makemat(arr.data, copy=False)
return array(data, mask=arr.mask)
def __getitem__(self, key):
@@ -1491,7 +1490,7 @@ class MAxisConcatenator(AxisConcatenator):
if isinstance(key, str):
raise MAError("Unavailable for masked array.")
- return super(MAxisConcatenator, self).__getitem__(key)
+ return super().__getitem__(key)
class mr_class(MAxisConcatenator):