-
numpy.ma.masked_all(shape, dtype=)
[source] -
Empty masked array with all elements masked.
Return an empty masked array of the given shape and dtype, where all the data are masked.
Parameters: shape : tuple
Shape of the required MaskedArray.
dtype : dtype, optional
Data type of the output.
Returns: a : MaskedArray
A masked array with all data masked.
See also
-
masked_all_like
- Empty masked array modelled on an existing array.
Examples
1234567891011>>>
import
numpy.ma as ma
>>> ma.masked_all((
3
,
3
))
masked_array(data
=
[[
-
-
-
-
-
-
]
[
-
-
-
-
-
-
]
[
-
-
-
-
-
-
]],
mask
=
[[
True
True
True
]
[
True
True
True
]
[
True
True
True
]],
fill_value
=
1e
+
20
)
The
dtype
parameter defines the underlying data type.123456>>> a
=
ma.masked_all((
3
,
3
))
>>> a.dtype
dtype(
'float64'
)
>>> a
=
ma.masked_all((
3
,
3
), dtype
=
np.int32)
>>> a.dtype
dtype(
'int32'
)
-
numpy.ma.masked_all()

2025-01-10 15:47:30
Please login to continue.