我想通過在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