📅  最后修改于: 2022-03-11 14:45:56.597000             🧑  作者: Mango
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])