擅长:python、mysql、java
<p>我写了这个,同时杰里米提供了一个非常成功和不错的答案,但我张贴地雷只是作为一个替代或更详细的方法。你知道吗</p>
<pre><code>keys = ['OpenInterest_x', 'Change in Open Interest x', 'LTP_x', 'NetChange_x', 'Volume_x', 'BidQty_x', 'BidPrice_x', 'OfferPrice_x', 'OfferQty_x', 'Strike Price', 'BidQty', 'BidPrice', 'OfferPrice', 'OfferQty', 'Volume', 'NetChange', 'LTP', 'OpenInterest', 'Change in Open Interest']
values = [
['150', '150', '1,070.00', '-928.90', '2', '450', '1,097.20', '1,314.15', '1,875', '4500.00', '375', '3.20', '10.25', '75', '-', '-', '-', '-', '-'],
['-', '-', '-', '-', '-', '150', '1,001.90', '1,056.15', '150', '4600.00', '75', '7.00', '17.80', '150', '4', '-7.55', '10.00', '1,350', '300']
]
dict_list = []
for value_list in values:
my_dict = {item[0]: item[1] for item in zip(keys, value_list)}
dict_list.append(my_dict)
</code></pre>