在python中计算一个多维数组的任意百分比分位数,只需用np.percentile即可,十分方便
import numpy as np
a = [154, 400, 1124, 82, 94, 108]
print np.percentile(a,95) # gives the 95th percentile
在python中计算一个多维数组的任意百分比分位数,只需用np.percentile即可,十分方便
import numpy as np
a = [154, 400, 1124, 82, 94, 108]
print np.percentile(a,95) # gives the 95th percentile