我在家裡跟lab想跑一個code,結果家裡跑得出來
但是在lab裡跑卻顯示"list index out of range "
想請問一下為什麼,是記憶體的問題嗎?
程式碼如下:
import gzip
import cPickle
cog_cats = {}
cogs_seqs = {}
cog_names = {}
pfam_seqs = {}
pfam_cog = {}
import os
if 'pfam_cog_dict.p' not in os.listdir('.'):
## map cog name to cog category
print 'mapping cog name to cog category'
with open('cogs.csv', 'r') as cog_file:
for line in cog_file:
line = line.rstrip()
line = line.split(',')
cog_cats[line[0]] = line[1]
cog_names[line[0]] = line[2]
print cog_cats
print cog_names
讀取的檔案的網址(.csv):
ftp://ftp.ncbi.nih.gov/pub/wolf/COGs/COG0303/cogs.csv
還請大家幫我解惑