擅长:python、mysql、java
<p>使用<a href="https://docs.python.org/2/library/collections.html#collections.defaultdict" rel="nofollow">defaultdict</a>,不要使用<code>dict</code>作为变量名,因为我们需要它来引用字典类型:</p>
<pre><code>import collections
d = collections.defaultdict(dict)
for i in kinetic_parameters:
d[i[1]][i[2]]=i[3]
</code></pre>
<p>这将自动创建词典。你知道吗</p>