码迷,mamicode.com
首页 > 其他好文 > 详细

numpy.percentile

时间:2016-03-31 23:02:10      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:

http://docs.scipy.org/doc/numpy/reference/generated/numpy.percentile.html

numpy.percentile(a, q, axis=None, out=None, overwrite_input=False, interpolation=‘linear‘, keepdims=False)[source]

Compute the qth percentile of the data along the specified axis.

Returns the qth percentile of the array elements.

>>> a = np.array([[10, 7, 4], [3, 2, 1]])
>>> a
array([[10,  7,  4],
[ 3, 2, 1]])
>>> np.percentile(a, 50)
array([ 3.5])
>>> np.percentile(a, 50, axis=0)
array([[ 6.5,  4.5,  2.5]])
>>> np.percentile(a, 50, axis=1)
array([[ 7.],
       [ 2.]])

 

numpy.percentile

标签:

原文地址:http://www.cnblogs.com/qqhfeng/p/5343003.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!