title: Combine two dictionaries and remove duplicates in python
body: <p>Hi I have two different dictionaries. And I am trying to merge those two by removing the duplicates. These are the 2 lists.</p>
  
  <pre><code>x = [{'relevance': 0.722, 'type': 'Company', 'name': 'Dell'}, {'relevance': 0.314, 'type': 'OperatingSystem', 'name': 'VMs'}, {'relevance': 0.122, 'type': 'Technology', 'name': 'iSCSI'}, {'relevance': 0.266, 'type': 'Company', 'name': 'Force10'}, {'relevance': 0.327, 'type': 'Person', 'name': 'Greg Althaus'}, {'relevance': 0.085, 'type': 'URL', 'name': 'http://Dell.com/OpenStack'}, {'relevance': 0.174, 'type': 'Company', 'name': 'Storage Hardware'}]
  y = [{'relevance': u'0.874065', 'type': u'Company', 'name': u'Dell'}, {'relevance': u'0.522169', 'type': u'OperatingSystem', 'name': u'VMs'}, {'relevance': u'0.444586', 'type': u'Person', 'name': u'Rob Hirschfeld'}, {'relevance': u'0.413988', 'type': u'Person', 'name': u'Greg Althaus'}, {'relevance': u'0.376489', 'type': u'FieldTerminology', 'name': u'iSCSI'}, {'relevance': u'0.314059', 'type': u'Company', 'name': u'Force10'}]
  </code></pre>
  
  <p>I have tried doing </p>
  
  <pre><code>z = x.update(y)
  print x
  </code></pre>
  
  <p>It gave me this error</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'update'`
  </code></pre>
  
  <p>I have tried this</p>
  
  <pre><code>z = dict(x.items() + y.items())
  </code></pre>
  
  <p>It gave me this error</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'items'
  </code></pre>
  
  <p>Then I tried</p>
  
  <pre><code>z = dict(x, **y)
  </code></pre>
  
  <p>It gave me this error</p>
  
  <pre><code>TypeError: type object argument after ** must be a mapping, not str
  </code></pre>
  
  <p>Then I tried</p>
  
  <pre><code>z = dict(chain(x.iteritems(), y.iteritems()))
  </code></pre>
  
  <p>It gave me this error</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'iteritems'
  </code></pre>