title: Merging dictionary value lists in python
body: <p>I'm trying to merge three dictionaries, which all have the same keys, and either lists of values, or single values.</p>
  
  <pre><code>one={'a': [1, 2], 'c': [5, 6], 'b': [3, 4]}
  two={'a': [2.4, 3.4], 'c': [5.6, 7.6], 'b': [3.5, 4.5]}
  three={'a': 1.2, 'c': 3.4, 'b': 2.3}
  </code></pre>
  
  <p>What I need is for all the items in the values to be added to one list.</p>
  
  <pre><code>result={'a': [1, 2, 2.4, 3.4, 1.2], 'c': [5, 6, 5.6, 7.6, 2.3], 'b': [3, 4, 3.5, 4.5, 3.4]}
  </code></pre>
  
  <p>I have tried several things, but most put the values into nested lists. 
  E.g.</p>
  
  <pre><code>out=dict((k, [one[k], two.get(k), three.get(k)]) for k in one)
  {'a': [[1, 2], [2.4, 3.4], 1.2], 'c': [[5, 6], [5.6, 7.6], 3.4], 'b': [[3, 4], [3.5, 4.5], 2.3]}
  </code></pre>
  
  <p>I tried updating it by looping through the values:</p>
  
  <pre><code>out.update((k, [x for x in v]) for k,v in out.iteritems())
  </code></pre>
  
  <p>but the results was exactly the same.
  I have tried to simply add the lists, but because the third dictionary has only a float, I couldn't do it. </p>
  
  <pre><code>check=dict((k, [one[k]+two[k]+three[k]]) for k in one)
  </code></pre>
  
  <p>So I tried to first add the lists in values of one and two, and then append the value of three. Adding the lists worked well, but then when I tried to append the float from the third dictionary, suddenly the whole value went to 'None'</p>
  
  <pre><code>check=dict((k, [one[k]+two[k]]) for k in one)
  {'a': [[1, 2, 2.4, 3.4]], 'c': [[5, 6, 5.6, 7.6]], 'b': [[3, 4, 3.5, 4.5]]}
  new=dict((k, v.append(three[k])) for k,v in check.items())
  {'a': None, 'c': None, 'b': None}
  </code></pre>