np.percentile()函数超详解 异常值极端值百分位四分位数
20211115
當有空值存在時,四分位數會是空值
20211019
https://www.zhihu.com/question/58421946
https://baike.baidu.com/item/%E5%9B%9B%E5%88%86%E4%BD%8D%E6%95%B0/5040599?fr=aladdin
上四分位數是大的那端
https://jingyan.baidu.com/article/20095761f8299dcb0621b455.html
計算步驟
https://zhuanlan.zhihu.com/p/235345817?utm_source=wechat_session
四分位數
順序從1開始計數 這里的計算也是不對的,最好按numpy默認的配置計算的結果為準
舉例 數列 1 2 3 4 5 6 7 8
上四分位=2x(3-2)*0.75=2.75
第一步 (n+1)/4=求的位置
aa=ndarray=[[1,2,3,4,5,6,7,8,9,10,100],[1,2,2,4,4,4,5,5,5,5,100]]
bb=pd.DataFrame(aa)
min=np.percentile(bb,1,axis=1,interpolation=‘higher’)
max=np.percentile(bb,99,axis=1,interpolation=‘higher’)
1,99 是索引的比例位置
higher lower,是取索引的小值還是大值
官方文檔入口:https://docs.scipy.org/doc/numpy/reference/generated/numpy.percentile.html
總結
以上是生活随笔為你收集整理的np.percentile()函数超详解 异常值极端值百分位四分位数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RuntimeError: Assert
- 下一篇: Python 中 (,|)和(and,o