numpy.ma.asarray

numpy.ma.asarray(a, dtype=None, order=None)

Convert the input a to a masked array of the given datatype.

Parameters:

a : array_like

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

dtype : data-type, 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. Defaults to ‘C’.

Returns:

out : ndarray

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

Previous topic

numpy.ma.MaskedArray.unshare_mask

Next topic

numpy.ma.asanyarray

This Page

Quick search