Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dictionary trouble
#1
Hello!
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?
Reply


Messages In This Thread
Dictionary trouble - by test - Sep-18-2018, 06:08 AM
RE: Dictionary trouble - by wavic - Sep-18-2018, 06:36 AM
RE: Dictionary trouble - by DeaD_EyE - Sep-18-2018, 07:26 AM
RE: Dictionary trouble - by test - Sep-18-2018, 09:04 AM
RE: Dictionary trouble - by DeaD_EyE - Sep-18-2018, 09:48 AM
RE: Dictionary trouble - by volcano63 - Sep-18-2018, 04:29 PM
RE: Dictionary trouble - by test - Sep-19-2018, 10:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dictionary trouble Involute 3 2,913 Oct-08-2019, 01:32 AM
Last Post: Involute
  Trouble retrieving dictionary from mysql.connector cursor swechsler 2 4,501 Sep-17-2019, 05:21 PM
Last Post: swechsler
  Trouble converting JSON String to Dictionary RBeck22 7 9,639 Mar-28-2019, 12:12 PM
Last Post: RBeck22

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020