I have an unknown number of dictionaries each identified by a specific code.
All of the values are create dynamically, so the codes to group by are unknown.
I am hoping someone might be able to help me identify the best way to group the dictionaries so that I can then move through each to produce a table. There are actually about 7 items in the dictionary.
Each dictionary is a row in the table.
example:
results = ['GROUP1':{'name':'Sam', 'code':'CDZ', 'cat_name':'category1', 'cat_code':'GROUP1'}, 'GROUP1':{'name':'James', 'code':'CDF', 'cat_name':'category1', 'cat_code':'GROUP1'}, 'GROUP2':{'name':'Ellie', 'code':'CDT', 'cat_name':'category2', 'cat_code':'GROUP2'}]
I want to be able to format these dictionaries into a table using to produce the following:
GROUP1 - category1
CODE | NAME
CDZ | Sam
CDF | James
GROUP2 - category2
CODE | NAME
CDT | Ellie
Thanks so much in advance.