热线电话:13121318867

登录
2018-12-18 阅读量: 720
python如何绘制柱形图?

柱形图用于显示不同属性之间的比较,或者它可以显示项目随时间的比较。

# Dataframe of previous code is used here

# Plot the bar chart for numeric values

# a comparison will be shown between

# all 3 age, income, sales

df.plot.bar()

# plot between 2 attributes

plt.bar(df['Age'], df['Sales'])

plt.xlabel("Age")

plt.ylabel("Sales")

plt.show()

0.0000
3
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子