DataFrame.quantile(self, q=0.5, axis=0, numeric_only=True, interpolation='linear')[source]
返回在请求轴上的给定的quantile值。
参数:q : float 或 array-like, 默认 0.5 (50% quantile)
要计算的quantile值在0 <= q <= 1之间。
axis : {0, 1, ‘index’, ‘columns’}(默认为 0)
行为0或' index ',列为1或'columns'。
numeric_only : bool,默认值True
如果为False,也将计算datetime和timedelta数据的quantile。
interpolation: {‘linear’, ‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}
这个可选参数指定了当所需quantile位于两个数据点i和j之间时要使用的插值方法:
1) linear: i + (j - i) *fraction,其中分数是指数中被i和j包围的小数部分。
2) lower: i
3) higher: j
4) nearest: i或j,以最接近的为准。
5) midpoint: (i + j) / 2
返回值:Series或 DataFrame
如果q是数组,则将返回DataFrame,其中
index是q,列是self的列,值是quantiles。
如果q为float