擅长:python、mysql、java
<p>可以使用嵌套在列表理解中的Dict理解创建要创建的对象列表:</p>
<pre><code>[{key_list[idx]: val for idx, val in enumerate(row)} for row in col]
</code></pre>
<blockquote>
<p>[{'m.year': '1997', 'm.gross': 'Par.', 'm.title': 'Titanic', 'm.studio': '2186.8'}, {'m.year': '2003', 'm.gross': 'NL', 'm.title': 'The Lord of the Rings: The Return of the King', 'm.studio': '1119.9'}]</p>
</blockquote>
<p>编辑:</p>
<p>对于<code>{ key: List }</code>的格言:</p>
<pre><code>dict(zip(key_list, [[row[idx] for row in col] for idx,_ in enumerate(key_list)]))
</code></pre>
<blockquote>
<p>{'m.year': ['1997', '2003'], 'm.gross': ['Par.', 'NL'], 'm.title': ['Titanic', 'The Lord of the Rings: The Return of the King'], 'm.studio': ['2186.8', '1119.9']}</p>
</blockquote>