I have a tsv file that contains the following variables with data below each variable. I want to only put the Drug Name, Description and the Targeted Virus into a dictionary. How do I do that?
Drug Name Drugbank ID Description Indication Targeted Virus
I have the following code, however it prints all the variables I have into the dictionary. I just want the Drug name, description and the targeted virus
import csv
data = csv.reader(open('flu_results.tsv'),delimiter='\t')
fields = data.next()
for row in data:
item = dict(zip(fields, row))
print item