def METHOD_NAME(some_matrix, replace_with=FLAG_BAD_SIGMA):
    """
    Replace nans with very large numbers
    """
    def _fixit(x):
        if np.isnan(x):
            return replace_with
        else:
            return x
    new_matrix = [[_fixit(x) for x in sigma_row] for sigma_row in some_matrix]
    new_matrix = np.array(new_matrix)
    return new_matrix