Skip to content

Commit 7fe7561

Browse files
koyuki7wcharris
authored andcommitted
DOC: Fix module setting of MaskedArray
Set module of ``MaskedArray`` to ``numpy.ma`` because ``numpy.ma.core.MaskedArray`` is an internal alias not documented. ref: gh-13114 [skip cirrus] [skip azp] [skip actions]
1 parent 218d916 commit 7fe7561

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

numpy/ma/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from numpy import array as narray, expand_dims, iinfo, finfo
3838
from numpy._core.numeric import normalize_axis_tuple
3939
from numpy._utils._inspect import getargspec, formatargspec
40+
from numpy._utils import set_module
4041

4142

4243
__all__ = [
@@ -2636,7 +2637,7 @@ class MaskedIterator:
26362637
>>> x = np.ma.array(arange(6).reshape(2, 3))
26372638
>>> fl = x.flat
26382639
>>> type(fl)
2639-
<class 'numpy.ma.core.MaskedIterator'>
2640+
<class 'numpy.ma.MaskedIterator'>
26402641
>>> for item in fl:
26412642
... print(item)
26422643
...
@@ -2717,6 +2718,7 @@ def __next__(self):
27172718
return d
27182719

27192720

2721+
@set_module("numpy.ma")
27202722
class MaskedArray(ndarray):
27212723
"""
27222724
An array class with possibly masked values.
@@ -8378,7 +8380,7 @@ def asarray(a, dtype=None, order=None):
83788380
mask=False,
83798381
fill_value=1e+20)
83808382
>>> type(np.ma.asarray(x))
8381-
<class 'numpy.ma.core.MaskedArray'>
8383+
<class 'numpy.ma.MaskedArray'>
83828384
83838385
"""
83848386
order = order or 'C'
@@ -8425,7 +8427,7 @@ def asanyarray(a, dtype=None):
84258427
mask=False,
84268428
fill_value=1e+20)
84278429
>>> type(np.ma.asanyarray(x))
8428-
<class 'numpy.ma.core.MaskedArray'>
8430+
<class 'numpy.ma.MaskedArray'>
84298431
84308432
"""
84318433
# workaround for #8666, to preserve identity. Ideally the bottom line

0 commit comments

Comments
 (0)