1df = pd.DataFrame(np.random.randn(100, 3))
2
3from scipy import stats
4df[(np.abs(stats.zscore(df)) < 3).all(axis=1)]
5
1q1 = df['column'].quantile(0.25)
2q3 = df['column'].quantile(0.75)
3iqr = q3 - q1
4
5df.loc[df['column'] > (q3 + 1.5 * iqr) | df['column'] < (q1 - 1.5 * iqr), 'column'] = df['column'].mean()
1#Removing outliers first then skewness
2from scipy.stats import zscore
3z=abs(zscore(df))
4print(z.shape)
5df=df[(z<3).all(axis=1)]
6df.shape