gpt4 book ai didi

pandas - Pandas 箱线图中的 mustache 究竟说明了什么?

转载 作者:行者123 更新时间:2023-12-03 21:31:26 25 4
gpt4 key购买 nike

在默认设置的 python-pandas boxplots 中,红色条是平均中位数,盒子表示第 25 个和第 75 个四分位数,但在这种情况下, mustache 究竟意味着什么?找出确切定义的文档在哪里(找不到)?

示例代码:

df.boxplot()

结果示例:

enter image description here

最佳答案

Pandas 只是包装了 matplotlib 中的 boxplot 函数。 matplotlib docs有详细的晶须定义:

whis : float, sequence, or string (default = 1.5)

As a float, determines the reach of the whiskers to the beyond the first and third quartiles. In other words, where IQR is the interquartile range (Q3-Q1), the upper whisker will extend to last datum less than Q3 + whis*IQR). Similarly, the lower whisker will extend to the first datum greater than Q1 - whis*IQR. Beyond the whiskers, data are considered outliers and are plotted as individual points.



Matplotlib(和 Pandas)还为您提供了许多更改 mustache 默认定义的选项:

Set this to an unreasonably high value to force the whiskers to show the min and max values. Alternatively, set this to an ascending sequence of percentile (e.g., [5, 95]) to set the whiskers at specific percentiles of the data. Finally, whis can be the string 'range' to force the whiskers to the min and max of the data.



下面的图形说明了 stats.stackexchange answer .请注意,如果您不提供 whis,则 k=1.5 Pandas 中的关键字。

enter image description here

关于pandas - Pandas 箱线图中的 mustache 究竟说明了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12082568/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com