Say that I have a list of dictionaries that looks like this:
list_1 =[{'A':1, 'B':2, 'C':3, 'D':4 , 'E':5},{'A':6 'B':7, 'C':8, 'D':9 , 'E':10}]
and my desired output is a second list of dictionaries with a single key:value pair, both dictionaries
list_2 = [{{'A':1, 'B':2, 'C':3, 'D':4} : {'E':5}}, {{'A':6 'B':7, 'C':8, 'D':9} : {'E':10}}]
I figured out how to create twom separeted list of dictionaries but I can't seem to find the next step.
list_of_keys = [{key : d[key] for key in set(['A', 'B', 'C', 'D'])} for d in l1]
list_of_values = [{key : d[key] for key in set(['E'])} for d in l1]
thx a lot in advance