Is it possible to take the value from a key value pair of a dictionary, and make that the key to the entire dictionary?
In case if what I'm asking is unclear,
I have a list of dictionaries, where the dictionaries look like this:
[{'HOUSE NAME': '1A', 'White Bread loaf large': 1, 'Brown Bread loaf large': 1,
'Skimmed Milk Pint': 1, 'Cheddar Cheese Medium 300g': 1}, ...]
and this is what I want to change it to:
[1A : {'White Bread loaf large': 1, 'Brown Bread loaf large': 1,
'Skimmed Milk Pint': 1, 'Cheddar Cheese Medium 300g': 1}, ...]
I'm new to python, and I haven't made an attempt because I really can't think where to start, and I can't seem to find anything online.