【发布时间】:2018-06-24 13:16:57
【问题描述】:
我已经知道this question,它运行良好,但字典的每个键中只有一个值。因此,例如这有效:
dictionary = {'group_1': 50, 'group_2': 70, 'group_3': 80}
但我想要的是使用每个键的两个值绘制一个条形图,以便我可以并排比较:
dictionary = {'group_2': (50, 60), 'group_2': (70, 40), 'group_3': (80, 20)}
如果我尝试使用这些值绘制条形图,我会得到一个
ValueError: shape mismatch: objects cannot be broadcast to a single shape
【问题讨论】:
标签: python matplotlib data-science data-analysis