I have a list of dictionaries, some of which share the same key at levels 1 and 2, some share the same key just a level 1, some don't share a key. I want to merge the dictionaries together starting from the top level.
input = [
d1 = {'a' : {'az' : {'a1': 2}}}
d2 = {'a' : {'az' : {'g' : 9}}}
d3 = {'a' : {'aa' : {'g' : 9}}}
d4 = {'b' : {'az' : {'g' : 9}}}
]
result = [
{'a': {'az' : {'a1' : 2, 'g' : 9}, {'aa' : {'g' : 9}}}
{'b' : {'az' : {'g' : 9}}}
]