SciPy, dtype=None, order=None)[source]

Convert the input to a masked array of the given data-type.

No copy is performed if the input is already an ndarray. If a is a subclass of MaskedArray, a base class MaskedArray is returned.

a : array_like

Input data, in any form that can be converted to a masked array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists, ndarrays and masked arrays.

dtype : dtype, optional

By default, the data-type is inferred from the input data.

order : {‘C’, ‘F’}, optional

Whether to use row-major (‘C’) or column-major (‘FORTRAN’) memory representation. Default is ‘C’.

out : MaskedArray

Masked array interpretation of a.

See also

Similar to asarray, but conserves subclasses.


>>> x = np.arange(10.).reshape(2, 5)
>>> x
array([[0., 1., 2., 3., 4.],
       [5., 6., 7., 8., 9.]])
  data=[[0., 1., 2., 3., 4.],
        [5., 6., 7., 8., 9.]],
>>> type(
<class ''>

Previous topic

Next topic