【发布时间】:2021-09-05 03:20:14
【问题描述】:
例如这是DataFrame
country_code ($) millions
0 USA 181519.23
1 CHN 18507.58
2 GBR 11342.63
3 IND 6064.06
4 CAN 4597.90
我想绘制直方图,其中 X 轴显示国家,Y 轴显示 Y 轴上的金额,
这可能吗?
【问题讨论】:
-
你的意思是像条形图吗?
-
对于 hist:
df.set_index('country_code').hist(grid=False)和对于 bardf.set_index('country_code').plot(kind='bar')
标签: python pandas data-science