Python deep merge dictionary data

Viewed 39043

Is there a library in Python that I can use to deep merge dictionaries:

The following:

a = { 'first' : { 'all_rows' : { 'pass' : 'dog', 'number' : '1' } } }
b = { 'first' : { 'all_rows' : { 'fail' : 'cat', 'number' : '5' } } }

When i combine I want this to look like:

a = { 'first' : { 'all_rows' : { 'pass' : 'dog', 'fail' : 'cat', 'number' : '5' } } }
1 Answers
Related