Entering edit mode
13.1 years ago
Azam
▴
60
HI all, How can I built matrix by reading whole files.I just need two things from file that enzyme code and E VALUES scores. Both characters are in two columns in 1000 lines. for this I wrote this code but it is not working.
f=open("output.txt")
data=f.readlines()
label=1
label_dictionary = {}
for lines in data:
print lines,
columns= lines.split()
print columns
if columns [1] not in label_dictionary:
label_dictionary[columns[1]]=label
label=label+1
if columns [-1] not in label_dictionary:
label_dictionary[columns[-1]] = label
label=label+1
print label_dictionary
print label_dictionary,[columns[1]],label_dictionary,[columns[-1]]