title: Force key as row entry when Parsing Json to Pandas
body: <p>I have a JSON object structured as follows (from the <a href="https://www.braze.com/docs/api/endpoints/export/canvas/get_canvas_analytics/#parameters" rel="nofollow noreferrer">Braze API</a>):</p>
  
  <pre><code>{
    "data": {
      "name": "name_of_canvas",
      "stats": [
        {
          "time": "2019-01-01",
          "total_stats": {
            "revenue": 0.0,
            "conversions": 123,
            "conversions_by_entry_time": 456,
            "entries": 1234
          },
          "step_stats": {
            "00000000-0000-0000-0000-0000000000000": {
              "name": "step_name",
              "revenue": 0.0,
              "conversions": 12,
              "conversions_by_entry_time": 34,
              "messages": {
                "email": [
                  {
                    "sent": 100,
                    "opens": 50,
                    "unique_opens": 48,
                    "clicks": 18,
                  }
                ],
              }
            },
          }
        },
      ]
    },
    "message": "success
  }
  </code></pre>
  
  <p>I want to parse it into a Pandas dataframe, structured as follows:</p>
  
  <pre><code>    df = pd.DataFrame(columns=['name', 'time', 'total_stats.revenue', 'total_stats.conversions', 
  'total_stats.conversions_by_entry_time', 'total_stats.entries', 'step_stats.step_id', 'step_stats.name', 'step_stats.revenue', 
  'step_stats.conversions', 'step_stats.conversions_by_entry_time', 'step_stats.messages.email.sent', 'step_stats.messages.email.opens', 'step_stats.messages.email.unique_opens', 'step_stats.messages.email.clicks'])
  </code></pre>
  
  <p>Critically, the <code>'step_stats.step_id'</code> column should contain the API identifier for the step as a <em>row entry</em>, rather than each step being split out into individual columns per step_id. </p>
  
  <p>I have tried using a recursive function to flatten the object, similar to <a href="https://stackoverflow.com/questions/57698215/how-to-parse-deeply-nested-json-to-pandas-dataframe">this</a>, however this results in the step_id being included in the column name rather than as a row entry. </p>
  
  <p>I have also spent some time playing with <code>pd.io.json.json_normalize</code>. The closest I have to the desired output is:</p>
  
  <pre><code>df = pd.io.json.json_normalize(
      data=dict_object['data']['stats'],
      meta='name')
  </code></pre>
  
  <p>But the step_id is still incorporated as part of column names:</p>
  
  <pre><code>  ... step_stats.00000000-0000-0000-0000-0000000000000.revenue| step_stats.00000000-0000-0000-0000-0000000000000.conversions| step_stats.00000000-0000-0000-0000-0000000000000.conversions_by_entry_time| step_stats.00000000-0000-0000-0000-0000000000000.conversions1| step_stats.00000000-0000-0000-0000-0000000000000.conversions1_by_entry_time ...
  </code></pre>
  
  <p>Is there any way to force pandas to interpret a key as a row entry in a database?</p>
  
  <p>Secondarily, is the above structure (specifically using a uuid as a key) good practice when structuring JSON objects? I'd like to know more out of curiosity than anything else.</p>