Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove outliers numpy array

import numpy as np
from scipy import stats
a = np.array([1,1,1,1,1,1,1,1,1,100])
a_no_outliers = a[(np.abs(stats.zscore(a)) < 3)]
print(a_no_outliers)
out: array([1, 1, 1, 1, 1, 1, 1, 1, 1])
 
PREVIOUS NEXT
Tagged: #remove #outliers #numpy #array
ADD COMMENT
Topic
Name
6+9 =