title: How to convert Nested JSON to Pandas Dataframe
body: <p>I have the following nested json:</p>
  <pre><code>import requests
  
      headers = {
          'Content-Type': 'application/json'
      }
      r = requests.get(&quot;...API DATA...&quot;)
      [
          {
              &quot;ticker&quot;:&quot;btcusd&quot;,
              &quot;baseCurrency&quot;:&quot;btc&quot;,
              &quot;quoteCurrency&quot;:&quot;usd&quot;,
              &quot;priceData&quot;:[
                  {
                      &quot;open&quot;:3914.749407813885,
                      &quot;high&quot;:3942.374263716895,
                      &quot;low&quot;:3846.1755315352952,
                      &quot;close&quot;:3849.1217299601617,
                      &quot;date&quot;:&quot;2019-01-02T00:00:00+00:00&quot;,
                      &quot;tradesDone&quot;:756.0,
                      &quot;volume&quot;:339.68131616889997,
                      &quot;volumeNotional&quot;:1307474.735327181
                  }
              ]
          }
      ]
  </code></pre>
  <p>I would like to convert it into Pandas data frame. I have been able to do this:</p>
  <pre><code>j = r.json()
  df = pd.DataFrame.from_dict(j)
  df
  </code></pre>
  <p>Output:</p>
  <p><a href="https://i.stack.imgur.com/VzfuN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VzfuN.png" alt="output" /></a></p>
  <p>I would like to also expand 'priceData' in columns.</p>
  <p>I have tried different methods, including json.normalise and json.loads, but there was always an error I could not understand.</p>
  <p>Could please anyone show me how to do it in order to understand?</p>
  <p>Thanks!</p>
  <p><strong>EDIT</strong></p>
  <p>priceData contains more than 1 element.</p>
  <p>&quot;ticker&quot;, &quot;baseCurrency&quot;, and &quot;quoteCurrency&quot; are not essentially needed in the data frame, hence can be discarded.</p>
  <p><a href="https://i.stack.imgur.com/miL3w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/miL3w.png" alt="part of json elements" /></a></p>