title: Remove dict which have the same id from a list of dict
body: <p>I want to remove from a list of dicts, dicts which have the same ID.</p>
  
  <pre><code>def removeDuplicate(elems, id):
      new_list = []
      for elem in elems:
          if not elem[id] in [d[id] for d in new_list if id in d]:
              new_list.append(elem)
      return new_list
  
  
  a = [
      {0 : 'a', 'id' : 2, 2 : 'c', time : '1'},
      {0 : 'a', 'id' : 2, 2 : 'c', time : '2'},
      {0 : 'a', 'id' : 3, 2 : 'c', time : '3'},
      {0 : 'a', 'id' : 4, 2 : 'c', time : '4'},
      {0 : 'a', 'id' : 5, 2 : 'c', time : '5'},
      {0 : 'a', 'id' : 4, 2 : 'c', time : '6'},
      {0 : 'a', 'id' : 2, 2 : 'c', time : '7'},
      {0 : 'a', 'id' : 3, 2 : 'c', time : '8'},
  ]
  print(a)
  
  a = removeDuplicate(a, 'id')
  
  print(a)
  </code></pre>
  
  <p>It's work fine for 7000 elements but it's take to much time for 500 000 elements.</p>
  
  <p>Is there a better way to delete these occurrences ?</p>