title: Getting specific field values from Json Python
body: <p>I have a JSON file, and what I am trying to do is getting this specific field '_id'. Problem is that when I use <code>json.load('input_file')</code>, it says that my variable  <code>data</code> is a list, not a dictionary, so I can't do something like:</p>
  
  <pre><code>for value in data['_id']:
      print(data['_id'][i])
  </code></pre>
  
  <p>because I keep getting this error: <strong>TypeError: list indices must be integers or slices, not str</strong></p>
  
  <p>What I also tried to do is:</p>
  
  <pre><code>data = json.load(input_file)[0]
  </code></pre>
  
  <p>It kinda works. Now, my type is a dictionary, and I can access like this: <code>data['_id']</code>
  But I only get the first '_id' from the archive... </p>
  
  <p>So, what I would like to do is add all '_id' 's values into a list, to use later.</p>
  
  <pre><code>input_file = open('input_file.txt')
  data = json.load(input_file)[0] 
  print(data['_id'])# only shows me the first '_id' value
  </code></pre>
  
  <p>Thanks for the help!</p>
  
  <pre><code>[{
   "_id": "5436e3abbae478396759f0cf",
   "name": "ISIC_0000000",
   "updated": "2015-02-23T02:48:17.495000+00:00"
  },
  {
   "_id": "5436e3acbae478396759f0d1",
   "name": "ISIC_0000001",
   "updated": "2015-02-23T02:48:27.455000+00:00"
  },
  {
  
   "_id": "5436e3acbae478396759f0d3",
   "name": "ISIC_0000002",
   "updated": "2015-02-23T02:48:37.249000+00:00"
  },
  {
   "_id": "5436e3acbae478396759f0d5",
   "name": "ISIC_0000003",
   "updated": "2015-02-23T02:48:46.021000+00:00"
   }]
  </code></pre>