python numpy求四分位距

import numpy as np

ages=[3,3,6,7,7,10,10,10,11,13,30]
lower_q=np.quantile(ages,0.25,interpolation='lower')#下四分位数
higher_q=np.quantile(ages,0.75,interpolation='higher')#上四分位数
int_r=higher_q-lower_q#四分位距
posted @ 2022-02-23 10:44  笨笨和呆呆  阅读(419)  评论(0)    收藏  举报