how can i remove the corresponding y values that correspond to the deleted outliers in x columns in python?

You need to save the mask then apply it on both X and Y.

z = np.abs(stats.zscore(X))
mask = (z < 3).all(axis=1)
X = X[mask]
Y = Y[mask]

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top