[英]Plot multiple bar graph of multiple pandas dataframe columns generated in a for loop
[英]Pandas dataframe multiple columns bar plot
按Age
列创建索引(如有必要),然后rename
列并最后使用DataFrame.plot.bar
:
d = {'Index 1':'Payment', 'Index 2':'Gender Focus',
'Index 3':'H&S General', 'Index 4': 'H&S Covid 19'}
df.set_index('Age').rename(columns=d).plot.bar()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.