python 去极值方法(三种举例)
import numpy as npimport pandas as pdfrom pandas import Seriesdef filter_extereme_MAD(series,n): median=series.quantile(0.5) n1_median=((series-median).abs()).quantile(0.50) max_rangef=median+n*n1_median min_range=median-n*n1_median .