Jan-20-2019, 11:18 AM
good morning guys,
I am trying to extract the descriptor in bold in a list (the list is in a file):
This is the content of the file: training_set_sub.txt
[['Verapamil', 'COC1=C(OC)C=C(CCN©CCCC(C#N)(C©C)C2=CC(OC)=C(OC)C=C2)C=C1', 0, 71, '0', '13', '2', 6, 7.0, 0.46, 5.09, '1', '0.60', '5.888', -2.447620829090909, '-7.093', '0'], ['Norverapamil', 'COC1=CC=C(CCNCCCC(C#N)(C©C)C2=CC(OC)=C(OC)C=C2)C=C1OC', 0, 68, '1', '13', '2', 6, 7.0, 0.46, 5.14, '1', '3.06', '5.914', -3.918865, '-7.435', '0']]
What I am doing is:
71
71
and I need to obtain
71
68
Could you help me, please?
I am trying to extract the descriptor in bold in a list (the list is in a file):
This is the content of the file: training_set_sub.txt
[['Verapamil', 'COC1=C(OC)C=C(CCN©CCCC(C#N)(C©C)C2=CC(OC)=C(OC)C=C2)C=C1', 0, 71, '0', '13', '2', 6, 7.0, 0.46, 5.09, '1', '0.60', '5.888', -2.447620829090909, '-7.093', '0'], ['Norverapamil', 'COC1=CC=C(CCNCCCC(C#N)(C©C)C2=CC(OC)=C(OC)C=C2)C=C1OC', 0, 68, '1', '13', '2', 6, 7.0, 0.46, 5.14, '1', '3.06', '5.914', -3.918865, '-7.435', '0']]
What I am doing is:
file = open('training_set_sub.txt','r') all = file.read().replace("'",'').split('], [') b = str(all).split(',') print (b) for row in all: print (b[3])but this way I obtain:
71
71
and I need to obtain
71
68
Could you help me, please?