Remove rows from X and y where either contains nans.

def filter_missing_X_and_y(X, y):
    """Remove rows from X and y where either contains nans."""
    y_nans = np.isnan(y)
    x_nans = np.isnan(X).any(axis=1)
    unioned_nans = np.logical_or(x_nans, y_nans)

    return X[~unioned_nans], y[~unioned_nans]