neulab/docprompting-conala huggingface dataset:
numpy.ma.hsplit   ma.hsplit(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_single object>
 
Split an array into multiple sub-arrays horizontally (column-wise). Please refer to the split documentation. hsplit is equivalent to split with axis=1, the array is always split along the second axis regardless of the array dimension.  See also  split

Split an array into multiple sub-arrays of equal size.    Notes The function is applied to both the _data and the _mask, if any. Examples >>> x = np.arange(16.0).reshape(4, 4)
>>> x
array([[ 0.,   1.,   2.,   3.],
       [ 4.,   5.,   6.,   7.],
       [ 8.,   9.,  10.,  11.],
       [12.,  13.,  14.,  15.]])
>>> np.hsplit(x, 2)
[array([[  0.,   1.],
       [  4.,   5.],
       [  8.,   9.],
       [12.,  13.]]),
 array([[  2.,   3.],
       [  6.,   7.],
       [10.,  11.],
       [14.,  15.]])]
>>> np.hsplit(x, np.array([3, 6]))
[array([[ 0.,   1.,   2.],
       [ 4.,   5.,   6.],
       [ 8.,   9.,  10.],
       [12.,  13.,  14.]]),
 array([[ 3.],
       [ 7.],
       [11.],
       [15.]]),
 array([], shape=(4, 0), dtype=float64)]
 With a higher dimensional array the split is still along the second axis. >>> x = np.arange(8.0).reshape(2, 2, 2)
>>> x
array([[[0.,  1.],
        [2.,  3.]],
       [[4.,  5.],
        [6.,  7.]]])
>>> np.hsplit(x, 2)
[array([[[0.,  1.]],
       [[4.,  5.]]]),
 array([[[2.,  3.]],
       [[6.,  7.]]])]
numpy.ma.hstack   ma.hstack(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_seq object>
 
Stack arrays in sequence horizontally (column wise). This is equivalent to concatenation along the second axis, except for 1-D arrays where it concatenates along the first axis. Rebuilds arrays divided by hsplit. This function makes most sense for arrays with up to 3 dimensions. For instance, for pixel-data with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations.  Parameters 
 
tupsequence of ndarrays


The arrays must have the same shape along all but the second axis, except 1-D arrays which can be any length.    Returns 
 
stackedndarray


The array formed by stacking the given arrays.      See also  concatenate

Join a sequence of arrays along an existing axis.  stack

Join a sequence of arrays along a new axis.  block

Assemble an nd-array from nested lists of blocks.  vstack

Stack arrays in sequence vertically (row wise).  dstack

Stack arrays in sequence depth wise (along third axis).  column_stack

Stack 1-D arrays as columns into a 2-D array.  hsplit

Split an array into multiple sub-arrays horizontally (column-wise).    Notes The function is applied to both the _data and the _mask, if any. Examples >>> a = np.array((1,2,3))
>>> b = np.array((4,5,6))
>>> np.hstack((a,b))
array([1, 2, 3, 4, 5, 6])
>>> a = np.array([[1],[2],[3]])
>>> b = np.array([[4],[5],[6]])
>>> np.hstack((a,b))
array([[1, 4],
       [2, 5],
       [3, 6]])
numpy.ma.identity   ma.identity(n, dtype=None) = <numpy.ma.core._convert2ma object>
 
Return the identity array. The identity array is a square array with ones on the main diagonal.  Parameters 
 
nint


Number of rows (and columns) in n x n output.  
dtypedata-type, optional


Data-type of the output. Defaults to float.  
likearray_like


Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it. In this case, it ensures the creation of an array object compatible with that passed in via this argument.  New in version 1.20.0.     Returns 
 
outMaskedArray


n x n array with its main diagonal set to one, and all other elements 0.     Examples >>> np.identity(3)
array([[1.,  0.,  0.],
       [0.,  1.,  0.],
       [0.,  0.,  1.]])
numpy.ma.indices   ma.indices(dimensions, dtype=<class 'int'>, sparse=False) = <numpy.ma.core._convert2ma object>
 
Return an array representing the indices of a grid. Compute an array where the subarrays contain index values 0, 1, … varying only along the corresponding axis.  Parameters 
 
dimensionssequence of ints


The shape of the grid.  
dtypedtype, optional


Data type of the result.  
sparseboolean, optional


Return a sparse representation of the grid instead of a dense representation. Default is False.  New in version 1.17.     Returns 
 
gridone MaskedArray or tuple of MaskedArrays


 If sparse is False:

Returns one array of grid indices, grid.shape = (len(dimensions),) + tuple(dimensions).  If sparse is True:

Returns a tuple of arrays, with grid[i].shape = (1, ..., 1, dimensions[i], 1, ..., 1) with dimensions[i] in the ith place        See also  
mgrid, ogrid, meshgrid

  Notes The output shape in the dense case is obtained by prepending the number of dimensions in front of the tuple of dimensions, i.e. if dimensions is a tuple (r0, ..., rN-1) of length N, the output shape is (N, r0, ..., rN-1). The subarrays grid[k] contains the N-D array of indices along the k-th axis. Explicitly: grid[k, i0, i1, ..., iN-1] = ik
 Examples >>> grid = np.indices((2, 3))
>>> grid.shape
(2, 2, 3)
>>> grid[0]        # row indices
array([[0, 0, 0],
       [1, 1, 1]])
>>> grid[1]        # column indices
array([[0, 1, 2],
       [0, 1, 2]])
 The indices can be used as an index into an array. >>> x = np.arange(20).reshape(5, 4)
>>> row, col = np.indices((2, 3))
>>> x[row, col]
array([[0, 1, 2],
       [4, 5, 6]])
 Note that it would be more straightforward in the above example to extract the required elements directly with x[:2, :3]. If sparse is set to true, the grid will be returned in a sparse representation. >>> i, j = np.indices((2, 3), sparse=True)
>>> i.shape
(2, 1)
>>> j.shape
(1, 3)
>>> i        # row indices
array([[0],
       [1]])
>>> j        # column indices
array([[0, 1, 2]])
numpy.ma.inner   ma.inner(a, b, /)[source]
 
Inner product of two arrays. Ordinary inner product of vectors for 1-D arrays (without complex conjugation), in higher dimensions a sum product over the last axes.  Parameters 
 
a, barray_like


If a and b are nonscalar, their last dimensions must match.    Returns 
 
outndarray


If a and b are both scalars or both 1-D arrays then a scalar is returned; otherwise an array is returned. out.shape = (*a.shape[:-1], *b.shape[:-1])    Raises 
 ValueError

If both a and b are nonscalar and their last dimensions have different sizes.      See also  tensordot

Sum products over arbitrary axes.  dot

Generalised matrix product, using second last dimension of b.  einsum

Einstein summation convention.    Notes Masked values are replaced by 0. For vectors (1-D arrays) it computes the ordinary inner-product: np.inner(a, b) = sum(a[:]*b[:])
 More generally, if ndim(a) = r > 0 and ndim(b) = s > 0: np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))
 or explicitly: np.inner(a, b)[i0,...,ir-2,j0,...,js-2]
     = sum(a[i0,...,ir-2,:]*b[j0,...,js-2,:])
 In addition a or b may be scalars, in which case: np.inner(a,b) = a*b
 Examples Ordinary inner product for vectors: >>> a = np.array([1,2,3])
>>> b = np.array([0,1,0])
>>> np.inner(a, b)
2
 Some multidimensional examples: >>> a = np.arange(24).reshape((2,3,4))
>>> b = np.arange(4)
>>> c = np.inner(a, b)
>>> c.shape
(2, 3)
>>> c
array([[ 14,  38,  62],
       [ 86, 110, 134]])
 >>> a = np.arange(2).reshape((1,1,2))
>>> b = np.arange(6).reshape((3,2))
>>> c = np.inner(a, b)
>>> c.shape
(1, 1, 3)
>>> c
array([[[1, 3, 5]]])
 An example where b is a scalar: >>> np.inner(np.eye(2), 7)
array([[7., 0.],
       [0., 7.]])
numpy.ma.innerproduct   ma.innerproduct(a, b, /)[source]
 
Inner product of two arrays. Ordinary inner product of vectors for 1-D arrays (without complex conjugation), in higher dimensions a sum product over the last axes.  Parameters 
 
a, barray_like


If a and b are nonscalar, their last dimensions must match.    Returns 
 
outndarray


If a and b are both scalars or both 1-D arrays then a scalar is returned; otherwise an array is returned. out.shape = (*a.shape[:-1], *b.shape[:-1])    Raises 
 ValueError

If both a and b are nonscalar and their last dimensions have different sizes.      See also  tensordot

Sum products over arbitrary axes.  dot

Generalised matrix product, using second last dimension of b.  einsum

Einstein summation convention.    Notes Masked values are replaced by 0. For vectors (1-D arrays) it computes the ordinary inner-product: np.inner(a, b) = sum(a[:]*b[:])
 More generally, if ndim(a) = r > 0 and ndim(b) = s > 0: np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))
 or explicitly: np.inner(a, b)[i0,...,ir-2,j0,...,js-2]
     = sum(a[i0,...,ir-2,:]*b[j0,...,js-2,:])
 In addition a or b may be scalars, in which case: np.inner(a,b) = a*b
 Examples Ordinary inner product for vectors: >>> a = np.array([1,2,3])
>>> b = np.array([0,1,0])
>>> np.inner(a, b)
2
 Some multidimensional examples: >>> a = np.arange(24).reshape((2,3,4))
>>> b = np.arange(4)
>>> c = np.inner(a, b)
>>> c.shape
(2, 3)
>>> c
array([[ 14,  38,  62],
       [ 86, 110, 134]])
 >>> a = np.arange(2).reshape((1,1,2))
>>> b = np.arange(6).reshape((3,2))
>>> c = np.inner(a, b)
>>> c.shape
(1, 1, 3)
>>> c
array([[[1, 3, 5]]])
 An example where b is a scalar: >>> np.inner(np.eye(2), 7)
array([[7., 0.],
       [0., 7.]])
numpy.ma.is_mask   ma.is_mask(m)[source]
 
Return True if m is a valid, standard mask. This function does not check the contents of the input, only that the type is MaskType. In particular, this function returns False if the mask has a flexible dtype.  Parameters 
 
marray_like


Array to test.    Returns 
 
resultbool


True if m.dtype.type is MaskType, False otherwise.      See also  ma.isMaskedArray

Test whether input is an instance of MaskedArray.    Examples >>> import numpy.ma as ma
>>> m = ma.masked_equal([0, 1, 0, 2, 3], 0)
>>> m
masked_array(data=[--, 1, --, 2, 3],
             mask=[ True, False,  True, False, False],
       fill_value=0)
>>> ma.is_mask(m)
False
>>> ma.is_mask(m.mask)
True
 Input must be an ndarray (or have similar attributes) for it to be considered a valid mask. >>> m = [False, True, False]
>>> ma.is_mask(m)
False
>>> m = np.array([False, True, False])
>>> m
array([False,  True, False])
>>> ma.is_mask(m)
True
 Arrays with complex dtypes don’t return True. >>> dtype = np.dtype({'names':['monty', 'pithon'],
...                   'formats':[bool, bool]})
>>> dtype
dtype([('monty', '|b1'), ('pithon', '|b1')])
>>> m = np.array([(True, False), (False, True), (True, False)],
...              dtype=dtype)
>>> m
array([( True, False), (False,  True), ( True, False)],
      dtype=[('monty', '?'), ('pithon', '?')])
>>> ma.is_mask(m)
False
numpy.ma.is_masked   ma.is_masked(x)[source]
 
Determine whether input has masked values. Accepts any object as input, but always returns False unless the input is a MaskedArray containing masked values.  Parameters 
 
xarray_like


Array to check for masked values.    Returns 
 
resultbool


True if x is a MaskedArray with masked values, False otherwise.     Examples >>> import numpy.ma as ma
>>> x = ma.masked_equal([0, 1, 0, 2, 3], 0)
>>> x
masked_array(data=[--, 1, --, 2, 3],
             mask=[ True, False,  True, False, False],
       fill_value=0)
>>> ma.is_masked(x)
True
>>> x = ma.masked_equal([0, 1, 0, 2, 3], 42)
>>> x
masked_array(data=[0, 1, 0, 2, 3],
             mask=False,
       fill_value=42)
>>> ma.is_masked(x)
False
 Always returns False if x isn’t a MaskedArray. >>> x = [False, True, False]
>>> ma.is_masked(x)
False
>>> x = 'a string'
>>> ma.is_masked(x)
False
numpy.ma.isarray   ma.isarray(x)[source]
 
Test whether input is an instance of MaskedArray. This function returns True if x is an instance of MaskedArray and returns False otherwise. Any object is accepted as input.  Parameters 
 
xobject


Object to test.    Returns 
 
resultbool


True if x is a MaskedArray.      See also  isMA

Alias to isMaskedArray.  isarray

Alias to isMaskedArray.    Examples >>> import numpy.ma as ma
>>> a = np.eye(3, 3)
>>> a
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> m = ma.masked_values(a, 0)
>>> m
masked_array(
  data=[[1.0, --, --],
        [--, 1.0, --],
        [--, --, 1.0]],
  mask=[[False,  True,  True],
        [ True, False,  True],
        [ True,  True, False]],
  fill_value=0.0)
>>> ma.isMaskedArray(a)
False
>>> ma.isMaskedArray(m)
True
>>> ma.isMaskedArray([0, 1, 2])
False
numpy.ma.isMA   ma.isMA(x)[source]
 
Test whether input is an instance of MaskedArray. This function returns True if x is an instance of MaskedArray and returns False otherwise. Any object is accepted as input.  Parameters 
 
xobject


Object to test.    Returns 
 
resultbool


True if x is a MaskedArray.      See also  isMA

Alias to isMaskedArray.  isarray

Alias to isMaskedArray.    Examples >>> import numpy.ma as ma
>>> a = np.eye(3, 3)
>>> a
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> m = ma.masked_values(a, 0)
>>> m
masked_array(
  data=[[1.0, --, --],
        [--, 1.0, --],
        [--, --, 1.0]],
  mask=[[False,  True,  True],
        [ True, False,  True],
        [ True,  True, False]],
  fill_value=0.0)
>>> ma.isMaskedArray(a)
False
>>> ma.isMaskedArray(m)
True
>>> ma.isMaskedArray([0, 1, 2])
False
numpy.ma.isMaskedArray   ma.isMaskedArray(x)[source]
 
Test whether input is an instance of MaskedArray. This function returns True if x is an instance of MaskedArray and returns False otherwise. Any object is accepted as input.  Parameters 
 
xobject


Object to test.    Returns 
 
resultbool


True if x is a MaskedArray.      See also  isMA

Alias to isMaskedArray.  isarray

Alias to isMaskedArray.    Examples >>> import numpy.ma as ma
>>> a = np.eye(3, 3)
>>> a
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> m = ma.masked_values(a, 0)
>>> m
masked_array(
  data=[[1.0, --, --],
        [--, 1.0, --],
        [--, --, 1.0]],
  mask=[[False,  True,  True],
        [ True, False,  True],
        [ True,  True, False]],
  fill_value=0.0)
>>> ma.isMaskedArray(a)
False
>>> ma.isMaskedArray(m)
True
>>> ma.isMaskedArray([0, 1, 2])
False
numpy.ma.make_mask   ma.make_mask(m, copy=False, shrink=True, dtype=<class 'numpy.bool_'>)[source]
 
Create a boolean mask from an array. Return m as a boolean mask, creating a copy if necessary or requested. The function can accept any sequence that is convertible to integers, or nomask. Does not require that contents must be 0s and 1s, values of 0 are interpreted as False, everything else as True.  Parameters 
 
marray_like


Potential mask.  
copybool, optional


Whether to return a copy of m (True) or m itself (False).  
shrinkbool, optional


Whether to shrink m to nomask if all its values are False.  
dtypedtype, optional


Data-type of the output mask. By default, the output mask has a dtype of MaskType (bool). If the dtype is flexible, each field has a boolean dtype. This is ignored when m is nomask, in which case nomask is always returned.    Returns 
 
resultndarray


A boolean mask derived from m.     Examples >>> import numpy.ma as ma
>>> m = [True, False, True, True]
>>> ma.make_mask(m)
array([ True, False,  True,  True])
>>> m = [1, 0, 1, 1]
>>> ma.make_mask(m)
array([ True, False,  True,  True])
>>> m = [1, 0, 2, -3]
>>> ma.make_mask(m)
array([ True, False,  True,  True])
 Effect of the shrink parameter. >>> m = np.zeros(4)
>>> m
array([0., 0., 0., 0.])
>>> ma.make_mask(m)
False
>>> ma.make_mask(m, shrink=False)
array([False, False, False, False])
 Using a flexible dtype. >>> m = [1, 0, 1, 1]
>>> n = [0, 1, 0, 0]
>>> arr = []
>>> for man, mouse in zip(m, n):
...     arr.append((man, mouse))
>>> arr
[(1, 0), (0, 1), (1, 0), (1, 0)]
>>> dtype = np.dtype({'names':['man', 'mouse'],
...                   'formats':[np.int64, np.int64]})
>>> arr = np.array(arr, dtype=dtype)
>>> arr
array([(1, 0), (0, 1), (1, 0), (1, 0)],
      dtype=[('man', '<i8'), ('mouse', '<i8')])
>>> ma.make_mask(arr, dtype=dtype)
array([(True, False), (False, True), (True, False), (True, False)],
      dtype=[('man', '|b1'), ('mouse', '|b1')])
numpy.ma.make_mask_descr   ma.make_mask_descr(ndtype)[source]
 
Construct a dtype description list from a given dtype. Returns a new dtype object, with the type of all fields in ndtype to a boolean type. Field names are not altered.  Parameters 
 
ndtypedtype


The dtype to convert.    Returns 
 
resultdtype


A dtype that looks like ndtype, the type of all fields is boolean.     Examples >>> import numpy.ma as ma
>>> dtype = np.dtype({'names':['foo', 'bar'],
...                   'formats':[np.float32, np.int64]})
>>> dtype
dtype([('foo', '<f4'), ('bar', '<i8')])
>>> ma.make_mask_descr(dtype)
dtype([('foo', '|b1'), ('bar', '|b1')])
>>> ma.make_mask_descr(np.float32)
dtype('bool')
numpy.ma.make_mask_none   ma.make_mask_none(newshape, dtype=None)[source]
 
Return a boolean mask of the given shape, filled with False. This function returns a boolean ndarray with all entries False, that can be used in common mask manipulations. If a complex dtype is specified, the type of each field is converted to a boolean type.  Parameters 
 
newshapetuple


A tuple indicating the shape of the mask.  
dtype{None, dtype}, optional


If None, use a MaskType instance. Otherwise, use a new datatype with the same fields as dtype, converted to boolean types.    Returns 
 
resultndarray


An ndarray of appropriate shape and dtype, filled with False.      See also  make_mask

Create a boolean mask from an array.  make_mask_descr

Construct a dtype description list from a given dtype.    Examples >>> import numpy.ma as ma
>>> ma.make_mask_none((3,))
array([False, False, False])
 Defining a more complex dtype. >>> dtype = np.dtype({'names':['foo', 'bar'],
...                   'formats':[np.float32, np.int64]})
>>> dtype
dtype([('foo', '<f4'), ('bar', '<i8')])
>>> ma.make_mask_none((3,), dtype=dtype)
array([(False, False), (False, False), (False, False)],
      dtype=[('foo', '|b1'), ('bar', '|b1')])
numpy.ma.mask_cols   ma.mask_cols(a, axis=<no value>)[source]
 
Mask columns of a 2D array that contain masked values. This function is a shortcut to mask_rowcols with axis equal to 1.  See also  mask_rowcols

Mask rows and/or columns of a 2D array.  masked_where

Mask where a condition is met.    Examples >>> import numpy.ma as ma
>>> a = np.zeros((3, 3), dtype=int)
>>> a[1, 1] = 1
>>> a
array([[0, 0, 0],
       [0, 1, 0],
       [0, 0, 0]])
>>> a = ma.masked_equal(a, 1)
>>> a
masked_array(
  data=[[0, 0, 0],
        [0, --, 0],
        [0, 0, 0]],
  mask=[[False, False, False],
        [False,  True, False],
        [False, False, False]],
  fill_value=1)
>>> ma.mask_cols(a)
masked_array(
  data=[[0, --, 0],
        [0, --, 0],
        [0, --, 0]],
  mask=[[False,  True, False],
        [False,  True, False],
        [False,  True, False]],
  fill_value=1)
numpy.ma.mask_or   ma.mask_or(m1, m2, copy=False, shrink=True)[source]
 
Combine two masks with the logical_or operator. The result may be a view on m1 or m2 if the other is nomask (i.e. False).  Parameters 
 
m1, m2array_like


Input masks.  
copybool, optional


If copy is False and one of the inputs is nomask, return a view of the other input mask. Defaults to False.  
shrinkbool, optional


Whether to shrink the output to nomask if all its values are False. Defaults to True.    Returns 
 
maskoutput mask


The result masks values that are masked in either m1 or m2.    Raises 
 ValueError

If m1 and m2 have different flexible dtypes.     Examples >>> m1 = np.ma.make_mask([0, 1, 1, 0])
>>> m2 = np.ma.make_mask([1, 0, 0, 0])
>>> np.ma.mask_or(m1, m2)
array([ True,  True,  True, False])
numpy.ma.mask_rowcols   ma.mask_rowcols(a, axis=None)[source]
 
Mask rows and/or columns of a 2D array that contain masked values. Mask whole rows and/or columns of a 2D array that contain masked values. The masking behavior is selected using the axis parameter.  If axis is None, rows and columns are masked. If axis is 0, only rows are masked. If axis is 1 or -1, only columns are masked.   Parameters 
 
aarray_like, MaskedArray


The array to mask. If not a MaskedArray instance (or if no array elements are masked). The result is a MaskedArray with mask set to nomask (False). Must be a 2D array.  
axisint, optional


Axis along which to perform the operation. If None, applies to a flattened version of the array.    Returns 
 
aMaskedArray


A modified version of the input array, masked depending on the value of the axis parameter.    Raises 
 NotImplementedError

If input array a is not 2D.      See also  mask_rows

Mask rows of a 2D array that contain masked values.  mask_cols

Mask cols of a 2D array that contain masked values.  masked_where

Mask where a condition is met.    Notes The input array’s mask is modified by this function. Examples >>> import numpy.ma as ma
>>> a = np.zeros((3, 3), dtype=int)
>>> a[1, 1] = 1
>>> a
array([[0, 0, 0],
       [0, 1, 0],
       [0, 0, 0]])
>>> a = ma.masked_equal(a, 1)
>>> a
masked_array(
  data=[[0, 0, 0],
        [0, --, 0],
        [0, 0, 0]],
  mask=[[False, False, False],
        [False,  True, False],
        [False, False, False]],
  fill_value=1)
>>> ma.mask_rowcols(a)
masked_array(
  data=[[0, --, 0],
        [--, --, --],
        [0, --, 0]],
  mask=[[False,  True, False],
        [ True,  True,  True],
        [False,  True, False]],
  fill_value=1)
numpy.ma.mask_rows   ma.mask_rows(a, axis=<no value>)[source]
 
Mask rows of a 2D array that contain masked values. This function is a shortcut to mask_rowcols with axis equal to 0.  See also  mask_rowcols

Mask rows and/or columns of a 2D array.  masked_where

Mask where a condition is met.    Examples >>> import numpy.ma as ma
>>> a = np.zeros((3, 3), dtype=int)
>>> a[1, 1] = 1
>>> a
array([[0, 0, 0],
       [0, 1, 0],
       [0, 0, 0]])
>>> a = ma.masked_equal(a, 1)
>>> a
masked_array(
  data=[[0, 0, 0],
        [0, --, 0],
        [0, 0, 0]],
  mask=[[False, False, False],
        [False,  True, False],
        [False, False, False]],
  fill_value=1)
 >>> ma.mask_rows(a)
masked_array(
  data=[[0, 0, 0],
        [--, --, --],
        [0, 0, 0]],
  mask=[[False, False, False],
        [ True,  True,  True],
        [False, False, False]],
  fill_value=1)
numpy.ma.masked_all   ma.masked_all(shape, dtype=<class 'float'>)[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 
 
shapetuple


Shape of the required MaskedArray.  
dtypedtype, optional


Data type of the output.    Returns 
 
aMaskedArray


A masked array with all data masked.      See also  masked_all_like

Empty masked array modelled on an existing array.    Examples >>> 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,
  dtype=float64)
 The dtype parameter defines the underlying data type. >>> 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_like   ma.masked_all_like(arr)[source]
 
Empty masked array with the properties of an existing array. Return an empty masked array of the same shape and dtype as the array arr, where all the data are masked.  Parameters 
 
arrndarray


An array describing the shape and dtype of the required MaskedArray.    Returns 
 
aMaskedArray


A masked array with all data masked.    Raises 
 AttributeError

If arr doesn’t have a shape attribute (i.e. not an ndarray)      See also  masked_all

Empty masked array with all elements masked.    Examples >>> import numpy.ma as ma
>>> arr = np.zeros((2, 3), dtype=np.float32)
>>> arr
array([[0., 0., 0.],
       [0., 0., 0.]], dtype=float32)
>>> ma.masked_all_like(arr)
masked_array(
  data=[[--, --, --],
        [--, --, --]],
  mask=[[ True,  True,  True],
        [ True,  True,  True]],
  fill_value=1e+20,
  dtype=float32)
 The dtype of the masked array matches the dtype of arr. >>> arr.dtype
dtype('float32')
>>> ma.masked_all_like(arr).dtype
dtype('float32')