def remove_negatives(x): 
    """ Remove all negative and NaN values from x

    Parameters
    ----------
    x: np.array
        An array

    Returns
    -------
    non_negative_x: np.array
        A copy of x which does not contain any negative (or NaN) values. The
        shape of non_negative_x depends on the number of negative/NaN values
        in x.
    """
    x = x[x >= 0]
    return x