title: removing json items from array if value is duplicate python
body: <p>I am incredibly new to python.</p>
  
  <p>I have an array full of json objects. Some of the json objects contain duplicated values. The array looks like this:</p>
  
  <pre><code> [{"id":"1","name":"Paul","age":"21"},
    {"id":"2","name":"Peter","age":"22"},
    {"id":"3","name":"Paul","age":"23"}]
  </code></pre>
  
  <p>What I am trying to do is to remove an item if the <code>name</code> is the same as another json object, and leave the first one in the array.</p>
  
  <p>So in this case I should be left with</p>
  
  <pre><code>  [{"id":"1"."name":"Paul","age":"21"},
    {"id":"2","name":"Peter","age":"22"}]
  </code></pre>
  
  <p>The code I currently have can be seen below and is largely <a href="https://stackoverflow.com/questions/17076345/remove-duplicates-from-json-data">based on this answer</a>:</p>
  
  <pre><code>import json
  ds = json.loads('python.json') #this file contains the json
  unique_stuff = { each['name'] : each for each in ds }.values()
  
  all_ids = [ each['name'] for each in ds ]
  unique_stuff = [ ds[ all_ids.index(text) ] for text in set(texts) ]
  
  print unique_stuff
  </code></pre>
  
  <p>I am not even sure that this line is working <code>ds = json.loads('python.json') #this file contains the json</code> as when I try and <code>print ds</code> nothing shows up in the console.</p>