quantile() 函数Series quantile q 0 5 nbsp interpolatio linear source Parameters q nbsp floatorarray like default0 5 50 quantile 0 lt q lt 1 thequantile s tocomputeint nbsp linear lower hi
Series.
quantile
(
q=0.5,
interpolation=’linear’
)
| Parameters: | q : float or array-like, default 0.5 (50% quantile)
0 <= q <= 1, the quantile(s) to compute
interpolation : {‘linear’, ‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}
This optional parameter specifies the interpolation method to use, when the desired quantile lies between two data points i and j:
- linear: i + (j – i) * fraction, where fraction is the fractional part of the index surrounded by i and j.
- lower: i.
- higher: j.
- nearest: i or j whichever is nearest.
- midpoint: (i + j) / 2.
|
| Returns: |
quantile : float or Series
if q is an array, a Series will be returned where the index is q and the values are the quantiles.
|
midpoint: (i + j) / 2.
统计学上的四分为函数
原则上q是可以取0到1之间的任意值的。但是有一个四分位数是q分位数中较为有名的。
所谓四分位数;即把数值由小到大排列并分成四等份,处于三个分割点位置的数值就是四分位数。
- 第1四分位数 (Q1),又称“较小四分位数”,等于该样本中所有数值由小到大排列后第25%的数字。
- 第2四分位数 (Q2),又称“中位数”,等于该样本中所有数值由小到大排列后第50%的数字。
- 第3四分位数 (Q3),又称“较大四分位数”,等于该样本中所有数值由小到大排列后第75%的数字。
第3四分位数与第1四分位数的差距又称四分位距(InterQuartile Range,IQR)
当q=0.25 0.5 0.75 时,就是在计算四分位数。
Return value at the given quantile, a la numpy.percentile
DataFrame. quantile ( q=0.5, axis=0, numeric_only=True )
| Parameters: | q : float or array-like, default 0.5 (50% quantile)
0 <= q <= 1, the quantile(s) to compute
axis : {0, 1, ‘index’, ‘columns’} (default 0)
0 or ‘index’ for row-wise, 1 or ‘columns’ for column-wise
|
| Returns: |
quantiles : Series or DataFrame
If q is an array, a DataFrame will be returned where the index is q, the columns are the columns of self, and the values are the quantiles. If q is a float, a Series will be returned where the index is the columns of self and the values are the quantiles.
|
Return values at the given quantile over requested axis, a la numpy.percentile.
相关阅读:
.
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/230356.html原文链接:https://javaforall.net