title: Joining two Python Dictionaries on key
body: <p>Have two Dictionaries in Python and would like to make a join using a key.</p>
  
  <p>The first dictionary "d" is OrderedDict like this:</p>
  
  <pre><code>[OrderedDict([
            ('id', '1'),
            ('date', '20170101'),
  OrderedDict([
            ('id', '2'),
            ('date', '20170102'),
  OrderedDict([
            ('id', '3'),
            ('date', '20170102')]
  </code></pre>
  
  <p>The second one "dd" is defaultdict and it's like this:</p>
  
  <pre><code>defaultdict(int, {'1': 14, '2': 5, '3': 7})
  </code></pre>
  
  <p>I want to make a join using possibilities of "operator" library and using keys but the approach is not working for me because I dont know exactly how should I treat the keys in defaultdict:</p>
  
  <pre><code>sort_key = operator.itemgetter("id")
  
  ks=[ k for k in dd.keys()]
  
  for i, j in zip(sorted(d, key=sort_key), sorted(dd,key=ks)):
      i.update(j)
  </code></pre>
  
  <p>How should I correctly perform the joining?</p>
  
  <p>Desirable output will be OrderedDict with additional values from the second dictionary:</p>
  
  <pre><code>[OrderedDict([
            ('id', '1'),
            ('date', '20170101'),
            ('quantity', '14'),
  OrderedDict([
            ('id', '2'),
            ('date', '20170102'),
            ('quantity', '5'),
  OrderedDict([
            ('id', '3'),
            ('date', '20170102'),
            ('quantity', '7')]
  </code></pre>
  
  <p>Thanks!</p>