def nan_to_num(array, copy=False):
if array.dtype.names is None:  <EOL><INDENT>return np.nan_to_num(array, copy=copy)<EOL><DEDENT>else:<EOL><INDENT>if copy:<EOL><INDENT>array = np.copy(array)<EOL><DEDENT>for column_name in array.dtype.names:<EOL><INDENT>np.nan_to_num(array[column_name], copy=False)<EOL><DEDENT>return array<EOL><DEDENT>
Like np.nan_to_num but also works on recarray

    Parameters
    ----------
    array : numpy.ndarray
    copy : boolean
        If True, return copy. If False, replace values in-place.

    Returns
    -------
    boolean