擅长:python、mysql、java
<p>除了“运气不佳”之外,你到底有什么问题</p>
<P>此外,我认为你应该考虑使用嵌套的DICT或列表。我不确定您是否可以通过从文件中加载新的代码变量来自动创建它们。无论如何,你想如何与他们合作</p>
<p>例如:</p>
<pre><code>peoples = {'Alice': {'AGATC': 2, 'AATG': 8, 'TATC': 3},
'Bob': {...}}
</code></pre>
<p>此外,您可以尝试使用csv.reader()</p>
<pre><code>with Path.open(csv_file) as file:
reader = csv.reader(file, delimiter=',')
for i, row in enumerate(reader):
if i == 0:
# first csv-line. Find the structure of your dict here
# or ignore it and hard-code it
else:
# values of the row can be accessed as list
</code></pre>