我使用的是这样编码的数据集:[
[
(u'90000', 100318),
(u'21000', 58094),
(u'50000', 14695),
(u'250000', 8190),
(u'100000', 5718),
(u'40000', 4276)
]
]
我想把它变成一个柱状图/条形图。在
我一直在看XXX,到目前为止我都是这样试过的:
^{pr2}$
但是,它产生了错误:
^{3}$
用于生成该数据结构的代码如下所示:with open('toy_two.json', 'rb') as inpt:
dict_hash_gas = list()
for line in inpt:
resource = json.loads(line)
dict_hash_gas.append({resource['first']:resource['second']})
# Count up the values
counts = collections.Counter(v for d in dict_hash_gas for v in d.values())
counts = counts.most_common()
# Apply a threshold
threshold = 4275
counts = [list(group) for val, group in