Python dictionary values merging based on specific key
<p>I want to merge two CSV files that I have read into python using the following code,</p>

<pre><code>a = csv.DictReader(csv1)
b = csv.DictReader(csv2)

aMap = {}
bMap = {}

for row in a:
    aMap[row['id']] = row

for row in b:
    bMap[row['id']] = row
</code></pre>

<p>Now I should have two dictionaries whose keys are the 'id' field from the two CSVs. What I want to do is take everything from the aMap and add the values to the corresponding key values to bMap. For example in aMap, a key in the dictionary looks like this,</p>

<pre><code>'123456' : {'name': 'SomeName', 'type': 'someType'}
</code></pre>

<p>And what I have in bMap is</p>

<pre><code>'123456' : {'location' : 'someLocation'}
</code></pre>

<p>And what I want is,</p>

<pre><code>'123456' : {'location' : 'someLocation', 'name' : 'SomeName', 'type' : 'someType'}
</code></pre>

<p>Is there a specific function for this or do I have to create a new dictionary? Something similar to update() but just appending values instead of updating.</p>
