我有一个格式化为熊猫数据帧的数据集。请参见seabornhttp://seaborn.pydata.org/generated/seaborn.factorplot.html#seaborn.factorplot中的示例
>>> import seaborn as sns
>>> sns.set(style="ticks")
>>> exercise = sns.load_dataset("exercise")
>>> g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise)
与sns.factorplot公司,我可以按组查看数据的平均值(对于本例,图表按“种类”显示1/15/30分钟组的脉搏平均值)。在
我想直接得到图表中的“值”。 例如
^{pr2}$我可以使用2深度循环来获得我想要的值,但我认为熊猫应该有更容易的东西,因为这是一个常见的要求。在
与matplotlib不同,matplotlib将返回绘图中的所有值,seaborn返回一个Facetgrid对象。Facetgrid似乎没有我想要的数据。在
我想您需要^{} 按列}和^{} }:
time
和{mean
和{^{pr2}$
相关问题 更多 >
编程相关推荐