2024-09-30 06:14:55 发布
网友
我有两个列上执行groupby的datafrme:
ax = df_all.groupby(['Component', 'SubComponent' ])['SubComponent'].count()
给我这个:
现在我想把它做成一个柱状图。 每个条形图将是组件,每个组件将划分在子组件上,显示每个子组件的出现次数,这些子组件具有不同的颜色。在
有没有简单的方法来完成它matplotlib.pyploy? 在
谢谢, 提交
您可以将^{}与^{}一起使用:
print (ax.unstack()) SubComponent First Second Third Component A 1 4 15 B 6 2 1 ax.unstack().plot.bar(stacked=True)
注意:
What is the difference between size and count in pandas?
您可以将^{} 与^{} 一起使用:
^{pr2}$
注意:
What is the difference between size and count in pandas?
相关问题 更多 >
编程相关推荐