Empty masked array with all elements masked.
Return an empty masked array of the given shape and dtype, where all the data are masked.
Shape of the required MaskedArray, e.g., (2, 3) or 2.
Data type of the output.
A masked array with all data masked.
See also
masked_all_likeEmpty masked array modelled on an existing array.
Unlike other masked array creation functions (e.g. numpy.ma.zeros, numpy.ma.ones, numpy.ma.full), masked_all does not initialize the values of the array, and may therefore be marginally faster. However, the values stored in the newly allocated array are arbitrary. For reproducible behavior, be sure to set each element of the array before reading.
>>> import numpy as np
>>> np.ma.masked_all((3, 3))
masked_array(
data=[[--, --, --],
[--, --, --],
[--, --, --]],
mask=[[ True, True, True],
[ True, True, True],
[ True, True, True]],
fill_value=1e+20,
dtype=float64)
The dtype parameter defines the underlying data type.
>>> a = np.ma.masked_all((3, 3))
>>> a.dtype
dtype('float64')
>>> a = np.ma.masked_all((3, 3), dtype=np.int32)
>>> a.dtype
dtype('int32')
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ma.masked_all.html