2024-05-19 12:34:58 发布
网友
我有一个数据框,其中包括两列产品名称和热量
Item Calories Beer 200 Hamburger 320
我想创建一个条形图,显示产品和每种产品的热量,但我希望条形图有相同的颜色
df2 = df.groupby(['Item'])['Calories'].mean() df2.plot.bar()[enter image description here][1]
卡路里×产品=df.groupby(['Item'])['carries'].mean()
carolis_by_product.plot.bar(color='blue')
卡路里×产品=df.groupby(['Item'])['carries'].mean()
carolis_by_product.plot.bar(color='blue')
相关问题 更多 >
编程相关推荐