Sep-18-2018, 06:08 AM
Hello!
I am having a dictionary of the type:
I am unable to think of any way to do it. Am i right in using dictionaries to do this task? What is the best way to do this?
I am having a dictionary of the type:
vars = { 'Hemoglobin' : ['HGB'], 'RBC count' : ['RBC COUNT', 'RBC COUNT.'], 'HCT' : ['HCT', 'HCT.'], 'MCV' : ['MCV', 'MCV.'], 'MCH' : ['MCH', 'MCH.'], 'MCHC' : ['MCHC', 'MCHC.'], 'WBC count' : ['WBC COUNT'], 'Neutrophils' : ['NEUTROPHIL'], 'Eosinophils' : ['EOSINOPHIL', 'EOSINOPHIL.'], 'Basophils' : ['BASOPHIL'], 'Lymphocytes' : ['LYMPHOCYTE', 'LYMPHOCYTE'] 'Monocytes' : ['MONOCYTE'], 'AEC' : ['AEC'], 'Platelets' : ['PLATELET', 'PLATELET.'] }I have another dictionary which contains the values of these parameters, with the parameter label set to one variable which is in the list, like:
d2 = {'BASOPHIL': '0.5', 'EOSINOPHIL.': '1.1', 'HCT.': '32.3', 'HGB': '10.0', 'LYMPHOCYTE.': '16.3', 'MCH.': '30.3', 'MCHC.': '31.0', 'MCV.': '97.9', 'MONOCYTE': '4.9', 'NEUTROPHIL': '77.2', 'PLATELET.': '606', 'RBC COUNT.': '3.30', 'WBC COUNT': '9.41'}I have to input these values into an excel sheet in which the variable names are set to the key values in vars.
I am unable to think of any way to do it. Am i right in using dictionaries to do this task? What is the best way to do this?