title: Reading Key value pairs of a JSON File
body: <p>My code is as follows: The JSON File is <a href="https://www.dropbox.com/s/uwqfqb27blxr1bj/citiesclimate_2014_03_27.json" rel="nofollow">https://www.dropbox.com/s/uwqfqb27blxr1bj/citiesclimate_2014_03_27.json</a></p>
  
  <p>A small sample:</p>
  
  <pre><code>[ { "_id" : { "$oid" : "5333d7e18828169279d9250d" },
      "actions" : null,
      "actions_nr" : 0,
      "city" : "Adachi City",
      "citylink" : "&lt;a href=\"/data/report/commitments/?tx_datareport_pi1%5Buid%5D=198\" target=\"_blank\" &gt;Adachi City&lt;/a&gt;",
      "commitments" : "338,339",
      "commitments_nr" : 1,
      "country" : "Japan",
      "latitude" : "35.465",
      "longitude" : "139.482",
      "performance" : "355,356,1090,1091",
      "performance_nr" : 4,
      "uid" : "198"
    },
    { "_id" : { "$oid" : "5333d7e18828169279d92511" },
      "test" : [ { "actions" : null,
            "actions_nr" : 0,
            "city" : "Adachi City",
            "citylink" : "&lt;a href=\"/data/report/commitments/?tx_datareport_pi1%5Buid%5D=198\" target=\"_blank\" &gt;Adachi City&lt;/a&gt;",
            "commitments" : "338,339",
            "commitments_nr" : 1,
            "country" : "Japan",
            "latitude" : "35.465",
            "longitude" : "139.482",
            "performance" : "355,356,1090,1091",
            "performance_nr" : 4,
            "uid" : "198"
          },
          { "actions" : "3025,3105,3106,3108,3109,3110,3111,3112,3113,3114,3115,3116,3164,3166,3167,3168,3170,3171,3172,3173,3174,3175,3176,3177,3180,3181,3182,3183,3184,3185,3187,3188,3189,3190,3191,3192,3193,3194,3196,3197,3410",
            "actions_nr" : 41,
            "city" : "Ahmadabad City",
            "citylink" : "&lt;a href=\"/data/report/commitments/?tx_datareport_pi1%5Buid%5D=549\" target=\"_blank\" &gt;Ahmadabad City&lt;/a&gt;",
            "commitments" : "816",
            "commitments_nr" : 1,
            "country" : "India",
            "latitude" : "23.0300",
            "longitude" : "72.5800",
            "performance" : "900,901",
            "performance_nr" : 2,
            "uid" : "549"
          }
        ]
    }
  ]
  </code></pre>
  
  <p>I keep getting string indices must be integers </p>
  
  <pre><code>json_file = source_json
  
  with open(json_file) as json_file:
  
      json_data = json.load(json_file)
  
      for e in json_data: # iterator over a dictionary
          #print e
          for key, value in e.iteritems():
              if key != '_id':
                  print key, value
                  #city_climate_data['city'] = value['test.city']
                  #print city_climate_data['city']
  </code></pre>