I have a list with values. From this list I would like to get the outliners.
list_of_values = [2, 3, 100, 5, 53, 5, 4, 7]
def detect_outlier(data):
threshold= 3
mean_1 = np.mean(data)
std_1 =np.std(data)
outliers = [y for y in data if (np.abs((y - mean_1)/std_1) > threshold)]
return outliers
print(detect_outlier(list_of_values))
However, my print turns up empty, aka a [] without anything in it. Any ideas?