Is there a numpy builtin to do something like the following? That is, take a list d and return a list filtered_d with any outlying elements removed
d
filtered_d
This method is almost identical to yours, just more numpyst (also working on numpy arrays only):
def reject_outliers(data, m=2): return data[abs(data - np.mean(data)) < m * np.std(data)]