i have a dictionary to which i want to append to each drug a list of numbers. like this:
append(0), append(1234), append(123).......
def make_drug_dictionary(data):
drug_dictionary={'MORPHINE':[],
'OXYCODONE':[],
'OXYMORPHONE':[],
'METHADONE':[],
'BUPRENORPHINE':[],
'HYDROMORPHONE':[],
'CODEINE':[],
'HYDROCODONE':[]}
prev = None
for row in data:
if prev is None or prev==row[11]:
drug_dictionary.append[row[11][]
return drug_dictionary
i later want to later be able to access the enter set of entries in for example 'MORPHINE'
- how do i append a number into the drug_dictionary?
- how do i later traverse through each entry?