outlier removal

Solutions on MaxInterview for outlier removal by the best coders in the world

showing results for - "outlier removal"
Osvaldo
12 Aug 2016
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()