title: Extract data from deeply-nested JSON
body: <p>I am new to JSON data and I am trying to get down to a very deeply nested dictionary that sits inside of 3 arrays and a dictionary of a JSON file. I am trying to get to the dictionary with the label &quot;player&quot;. I am trying to extract the players for all teams to then move into a DataFrame so I can use for other analysis.</p>
  <p>How do i write loop to get to this data?</p>
  <p>This is what I'm trying to do but it doesn't work:</p>
  <pre><code>rostered = json.dumps(rostered_players)
  player_value = [[
                  values['playerPoolEntry']['player']
                  ]for values in rostered]
  </code></pre>
  <p>Here is a sample of data that I am working with:</p>
  <pre><code>rostered = 
  '''[
    [    
      {
      &quot;appliedStatTotal&quot;: 260.05,
      &quot;entries&quot;: [
          [
              {
              &quot;injuryStatus&quot;: &quot;NORMAL&quot;,
              &quot;lineupSlotId&quot;: 2,
              &quot;playerId&quot;: 2977644,
              &quot;playerPoolEntry&quot;: {
                                  &quot;appliedStatTotal&quot;: 37.6,
                                  &quot;id&quot;: 2977644,
                                  &quot;keeperValue&quot;: 56,
                                  &quot;keeperValueFuture&quot;: 56,
                                  &quot;lineupLocked&quot;: false,
                                  &quot;onTeamId&quot;: 1,
                                  &quot;player&quot;:   {
                                              &quot;firstName&quot;: &quot;Todd&quot;,
                                              &quot;fullName&quot;: &quot;Todd Gurley II&quot;,
                                              &quot;id&quot;: 2977644,
                                              &quot;injuryStatus&quot;: &quot;ACTIVE&quot;,
                                              &quot;lastName&quot;: &quot;Gurley II&quot;
                                              },
              &quot;rosterLocked&quot;: false,
              &quot;tradeLocked&quot;: false
                                  }
                  }
              ]
          ]
      }
  ],
      [
          {
              &quot;appliedStatTotal&quot;: 260.05,
              &quot;entries&quot;: [
              [
                  {
                  &quot;injuryStatus&quot;: &quot;NORMAL&quot;,
                  &quot;lineupSlotId&quot;: 4,
                  &quot;playerId&quot;: 3892889,
                  &quot;playerPoolEntry&quot;: {
                                  &quot;appliedStatTotal&quot;: 6.6000000000000005,
                                  &quot;id&quot;: 3892889,
                                  &quot;keeperValue&quot;: 5,
                                  &quot;keeperValueFuture&quot;: 5,
                                  &quot;lineupLocked&quot;: false,
                                  &quot;onTeamId&quot;: 2,
                                  &quot;player&quot;:   {
                                              &quot;defaultPositionId&quot;: 3,
                                              &quot;firstName&quot;: &quot;Dede&quot;,
                                              &quot;fullName&quot;: &quot;Dede Westbrook&quot;,
                                              &quot;id&quot;: 3892889,
                                              &quot;lastName&quot;: &quot;Westbrook&quot;
                                              },
              &quot;rosterLocked&quot;: false,
              &quot;tradeLocked&quot;: false
                                      }
                      }
                  ]
              ]
          }
      ]
  ]'''
  </code></pre>