bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / ma / extras / masked_all
function
numpy.ma.extras:masked_all
source: build-install/usr/lib/python3.14/site-packages/numpy/ma/extras.py :120
Signature
def masked_all ( shape , dtype = <class 'float'> ) Summary
Empty masked array with all elements masked.
Extended Summary
Return an empty masked array of the given shape and dtype, where all the data are masked.
Parameters
shape: int or tuple of intsShape of the required MaskedArray, e.g.,
(2, 3)or2.dtype: dtype, optionalData type of the output.
Returns
a: MaskedArrayA masked array with all data masked.
Notes
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.
Examples
import numpy as np np.ma.masked_all((3, 3))✓
a = np.ma.masked_all((3, 3)) a.dtype a = np.ma.masked_all((3, 3), dtype=np.int32) a.dtype✓
See also
- masked_all_like
Empty masked array modelled on an existing array.
Aliases
-
numpy.ma.masked_all