我有2个数据框,其中包含品牌和数量。
例:
brand | count
------+-------
Gucci | 1234
Chanel| 234444
DF1的品牌多于DF2。我想创建一个条形图,其中x轴是所有品牌,y轴是计数。我不知道如何实现这一点,因此我得到了按品牌分组的每个数据框的并排条形图。
ax = df_pred.plot()
prev_pred.plot(ax=ax)
plt.show()
我试过这个代码,但我不能按品牌分组。我使用sns.barplot创建单独的条形图,但我想覆盖它们。我想要DF1中的所有品牌,因此DF2的一些计数将为0,但这是我想要比较的。任何帮助深表感谢。