我试图用置信区间绘制一个箱线图,但我得到了一个例外。
<HashRouter>
Youradvice将不胜感激
答案 0 :(得分:0)
您需要将置信区间指定为与您正在绘制的要素对应的元组列表。在您的情况下,您只绘制列'a',因此您需要指定一个包含一个元组的列表:
iris.boxplot(column='a', figsize=(15,20), notch=True, showmeans = True, \
patch_artist = True, conf_intervals = [(4, 7)], bootstrap = 10000)
plt.show()
生成下图
但是,根据文档,如果您进行自举,则conf_intervals应为None,因为它会覆盖bootstrapping计算的参数。 https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.boxplot.html
因此,对于'a',如果conf_intervals为None,则输出为:
iris.boxplot(column='a', figsize=(15,20), notch=True, showmeans = True, \
patch_artist = True, conf_intervals = [None], bootstrap = 10000)
plt.show()