def fromrecords(reclist, dtype=None, shape=None, formats=None, names=None,<EOL>titles=None, aligned=False, byteorder=None,<EOL>fill_value=None, mask=nomask):
<EOL>_mask = getattr(reclist, '<STR_LIT>', None)<EOL>try:<EOL><INDENT>nfields = len(reclist[<NUM_LIT:0>])<EOL><DEDENT>except TypeError:<EOL><INDENT>nfields = len(reclist[<NUM_LIT:0>].dtype)<EOL><DEDENT>if isinstance(reclist, ndarray):<EOL><INDENT>if isinstance(reclist, MaskedArray):<EOL><INDENT>reclist = reclist.filled().view(ndarray)<EOL><DEDENT>if dtype is None:<EOL><INDENT>dtype = reclist.dtype<EOL><DEDENT>reclist = reclist.tolist()<EOL><DEDENT>mrec = recfromrecords(reclist, dtype=dtype, shape=shape, formats=formats,<EOL>names=names, titles=titles,<EOL>aligned=aligned, byteorder=byteorder).view(mrecarray)<EOL>if fill_value is not None:<EOL><INDENT>mrec.fill_value = fill_value<EOL><DEDENT>if mask is not nomask:<EOL><INDENT>mask = np.array(mask, copy=False)<EOL>maskrecordlength = len(mask.dtype)<EOL>if maskrecordlength:<EOL><INDENT>mrec._mask.flat = mask<EOL><DEDENT>elif len(mask.shape) == <NUM_LIT:2>:<EOL><INDENT>mrec._mask.flat = [tuple(m) for m in mask]<EOL><DEDENT>else:<EOL><INDENT>mrec.__setmask__(mask)<EOL><DEDENT><DEDENT>if _mask is not None:<EOL><INDENT>mrec._mask[:] = _mask<EOL><DEDENT>return mrec<EOL>
Creates a MaskedRecords from a list of records.

    Parameters
    ----------
    reclist : sequence
        A list of records. Each element of the sequence is first converted
        to a masked array if needed. If a 2D array is passed as argument, it is
        processed line by line
    dtype : {None, dtype}, optional
        Data type descriptor.
    shape : {None,int}, optional
        Number of records. If None, ``shape`` is defined from the shape of the
        first array in the list.
    formats : {None, sequence}, optional
        Sequence of formats for each individual field. If None, the formats will
        be autodetected by inspecting the fields and selecting the highest dtype
        possible.
    names : {None, sequence}, optional
        Sequence of the names of each field.
    fill_value : {None, sequence}, optional
        Sequence of data to be used as filling values.
    mask : {nomask, sequence}, optional.
        External mask to apply on the data.

    Notes
    -----
    Lists of tuples should be preferred over lists of lists for faster processing.