我想通过在Seaborn (即媒体,四分位数)中生成的箱线获取具体的值。例如,在下面的boxplot(来源:link) 有什么方法可以获取媒体和四分位数而不是手动估计?在Seaborn boxplot中获取值
import numpy as np
import seaborn as sns
sns.set(style="ticks", palette="muted", color_codes=True)
# Load the example planets dataset
planets = sns.load_dataset("planets")
# Plot the orbital period with horizontal boxes
ax = sns.boxplot(x="distance", y="method", data=planets,
whis=np.inf, color="c")
尝试'np.median'? – mwaskom
我试过'np.median(行星)',我得到了一个价值,而不是每个箱子的媒体。我会感谢任何见解。 – Omar
我会熟悉熊猫groupby方法:http://pandas.pydata.org/pandas-docs/stable/groupby.html – mwaskom