如何从列表中检测大纲



我有一个值列表。我想从这个列表中得到提纲。

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))
然而,我的打印结果是空的,也就是没有任何内容的a[]。什么好主意吗?

由于std_1 = 33.413, list_of_values中的任何元素除以std_1都小于阈值,因此不产生

最新更新