quantile() 函数

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’}

New in version 0.18.0.

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.5axis=0numeric_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

(0)
上一篇 2026年3月3日 下午3:01
下一篇 2026年3月3日 下午3:22


相关推荐

  • html layui分页代码,layui分页效果实现代码

    html layui分页代码,layui分页效果实现代码本文实例为大家分享了 layui 分页效果的具体代码 供大家参考 具体内容如下分页开门见山 默认分页开启 URLhash 是时候看一下完整功能了 layui use laypage layer function varlaypage layui laypage layer layui layer laypage cont demo1 pages 100

    2026年3月18日
    1
  • Matlab2018a安装包Linux版本

    Matlab2018a安装包Linux版本Matlab2018a安装包:链接:https://pan.baidu.com/s/1TAT6ZF98Qf6spBY63u5pJQ提取码:3c75安装教程参考主页之前的博文。

    2022年6月4日
    43
  • 学习SQL Server这一篇就够了

    学习SQL Server这一篇就够了目录第一章数据库概述1.1、数据库的好处1.2、数据库的常见概念1.3、数据库的存储特点1.4、数据库的常见分类1.5、SQL语言的分类第二章SQLServer概述2.1、SQLServer的概述2.2、SQLServer的下载2.3、SQLServer的安装2.4、SQLServer的第一种连接2.5、SQLServer的第二种连接2.6、SQLServer的连接说明第三章SQLServer数据库管理3.1、创建数据库3.1.1、界面方式3.1.2、命令方式3.2、修改数据库3.2.

    2022年7月27日
    10
  • 【工具】Pycharm:连接Mysql失败的简单解决

    【工具】Pycharm:连接Mysql失败的简单解决以前都是 Pycharm 中连接和写入数据库 在 MysqlWorkben 里面查看数据是否写入成功 倒也没觉得有什么问题 今天突然看到 在 Pycharm 中还可以直接查看 Mysql 的数据 类似于这样 Pycharm 连接 Mysql 的教程 请查看 https www cnblogs com QiKa p 14225469 html 按照教程来 没想到最后测试连接 竟然失败了 我很确信自己的 MYSQL 处于正常状态 相关的服务也是开启了的 user 和密码都是正确的 正常打开 MysqlWorkbe

    2026年3月19日
    3
  • php随机数生成漏洞函数,php随机数生成函数[通俗易懂]

    php随机数生成漏洞函数,php随机数生成函数[通俗易懂]functionrandpw($len=8,$format=’ALL’){$is_abc=$is_numer=0;$password=$tmp=”;switch($format){case’ALL’:$chars=’ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789′;break;case’CHAR’:…

    2025年6月10日
    4
  • 2017android面试题「建议收藏」

    2017android面试题「建议收藏」转载地址:http://www.2cto.com/kf/201702/603678.html

    2022年5月21日
    38

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号