Created
February 19, 2019 16:57
-
-
Save stefanondisponibile/1e8457ec856c2034c92c27a6fbeea09d to your computer and use it in GitHub Desktop.
Drops outliers from a dataframe with zscore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from scipy import stats | |
# df = ..... | |
df = df[(np.abs(stats.zscore(df[feature_cols])) < 3).all(axis=1)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment