title: How to get nested dictionary from JSON in Python
body: <p>I would like to take some JSON, convert it into a dictionary and then change some of the values in that dictionary.</p>
  
  <p>I've tried a few things as shown below but I can't get it to work as intended.</p>
  
  <p>My JSON is as follows:</p>
  
  <pre><code>{
     "9":[
        {
           "09_000":{
              "name":"Wyatt Feldt",
              "1":"R",
              "2":"L",
              "w":1,
              "h_t":1
           }
        },
        {
           "09_001":{
              "name":"Clayton Friend",
              "1":"R",
              "2":"R",
              "w":0,
              "h_t":0
           }
        }
     ],
     "10":[
        {
           "09_000":{
              "name":"Wyatt Feldt",
              "1":"R",
              "2":"L",
              "w":1,
              "h_t":1
           }
        },
        {
           "09_001":{
              "name":"Clayton Friend",
              "1":"R",
              "2":"R",
              "w":0,
              "h_t":0
           }
        }
     ],
     "11":[
        {
           "09_000":{
              "name":"Wyatt Feldt",
              "1":"R",
              "2":"L",
              "w":1,
              "h_t":1
           }
        },
        {
           "09_001":{
              "name":"Clayton Friend",
              "1":"R",
              "2":"R",
              "w":0,
              "h_t":0
           }
        }
     ]
  }
  </code></pre>
  
  <p>And then in Python I have written <code>print(my_data["9"][0])</code> which returns {'09_000': {'name': 'Wyatt Feldt', '1': 'R', '2': 'L', 'w': 1, 'h_t': 1}}. </p>
  
  <p>However, I just want it to return {'name': 'Wyatt Feldt', '1': 'R', '2': 'L', 'w': 1, 'h_t': 1} because I don't just want to print it, I want to set some of the values e.g. the name. And I know I can do that by doing <code>my_data["9"][0]["09_000"]</code> but I don't want to use that ID in order to get it (only the outer group, the index and then the key e.g. "name"). Since I'm already returning {'09_000': {'name': 'Wyatt Feldt', '1': 'R', '2': 'L', 'w': 1, 'h_t': 1}} I'm sure there must be a way to just get the nested part ({'name': 'Wyatt Feldt', '1': 'R', '2': 'L', 'w': 1, 'h_t': 1}) so I can change the values.</p>
  
  <p>EDIT: I think it's a different issue. My <code>my_data</code> variable is already in dictionary format, and this is a special case of indexing.</p>