def masked_rec_array_to_mgr(data, index, columns, dtype, copy):
<EOL>fill_value = data.fill_value<EOL>fdata = ma.getdata(data)<EOL>if index is None:<EOL><INDENT>index = get_names_from_index(fdata)<EOL>if index is None:<EOL><INDENT>index = ibase.default_index(len(data))<EOL><DEDENT><DEDENT>index = ensure_index(index)<EOL>if columns is not None:<EOL><INDENT>columns = ensure_index(columns)<EOL><DEDENT>arrays, arr_columns = to_arrays(fdata, columns)<EOL>new_arrays = []<EOL>for fv, arr, col in zip(fill_value, arrays, arr_columns):<EOL><INDENT>mask = ma.getmaskarray(data[col])<EOL>if mask.any():<EOL><INDENT>arr, fv = maybe_upcast(arr, fill_value=fv, copy=True)<EOL>arr[mask] = fv<EOL><DEDENT>new_arrays.append(arr)<EOL><DEDENT>arrays, arr_columns = reorder_arrays(new_arrays, arr_columns, columns)<EOL>if columns is None:<EOL><INDENT>columns = arr_columns<EOL><DEDENT>mgr = arrays_to_mgr(arrays, arr_columns, index, columns, dtype)<EOL>if copy:<EOL><INDENT>mgr = mgr.copy()<EOL><DEDENT>return mgr<EOL>
Extract from a masked rec array and create the manager.