title: Reform to a new json
body: <p>all, I am trying to convert the JSON data from airtable to a different form in a new JSON, however I am stuck. Here is that JSON I got from airtable:<br></p>
  <pre><code>dataset = {&quot;records&quot;: [{&quot;id&quot;: &quot;recVqe2l15WKanDS1&quot;, &quot;fields&quot;: {&quot;confirm&quot;: &quot;2&quot;, &quot;state&quot;: &quot;MA\n&quot;, &quot;time&quot;: &quot;2019-01-01&quot;, &quot;predict&quot;: &quot;2&quot;}, &quot;createdTime&quot;: &quot;2020-09-19T01:53:47.000Z&quot;}, 
  {&quot;id&quot;: &quot;rechRMD3sKzsweZO8&quot;, &quot;fields&quot;: {&quot;confirm&quot;: &quot;1&quot;, &quot;state&quot;: &quot;MA\n&quot;, &quot;time&quot;: &quot;2019-01-01&quot;, &quot;predict&quot;: &quot;1&quot;}, &quot;createdTime&quot;: &quot;2020-09-19T01:53:47.000Z&quot;}, 
  {&quot;id&quot;: &quot;recnO0uTnz3LmJNGF&quot;, &quot;fields&quot;: {&quot;confirm&quot;: &quot;3&quot;, &quot;state&quot;: &quot;MA\n&quot;, &quot;time&quot;: &quot;2019-01-01&quot;, &quot;predict&quot;: &quot;3&quot;}, &quot;createdTime&quot;: &quot;2020-09-19T01:53:47.000Z&quot;}]}
  </code></pre>
  <p>The only thing I need is the information in each<code>&quot;fields&quot;</code> and the key of<code> &quot;state&quot;</code>. So that it will look like:<br></p>
  <pre><code>{
      MA:[{&quot;confirm&quot;: &quot;2&quot;, &quot;time&quot;: &quot;2019-01-01&quot;, &quot;predict&quot;: &quot;2&quot;},
      {&quot;confirm&quot;: &quot;1&quot;, &quot;time&quot;: &quot;2019-01-01&quot;, &quot;predict&quot;: &quot;1&quot;},
      {&quot;confirm&quot;: &quot;3&quot;,  &quot;time&quot;: &quot;2019-01-01&quot;, &quot;predict&quot;: &quot;3&quot;}
      ....(there could be more state data like this)
  }
  
  </code></pre>
  <p>In this case, I first removed the <code>state:MA\n</code>from the original data and move it to the front  with colon. Here is what I've tried so far<br></p>
  <pre><code>records = dataset['records']
  for i in records:
      fields = i['fields']
      state = i['fields'].get('state')
      
  print(state)
  </code></pre>
  <p>And the output will be like:</p>
  <pre><code>MA
  MA
  MA
  </code></pre>
  <p>And I am able to get the fields data like this:</p>
  <pre><code>records = dataset['records']
  for i in records:
      fields = i['fields']
      print(fields)
  </code></pre>
  <p>which looks like this:</p>
  <pre><code>{'confirm': '2', 'state': 'MA\n', 'time': '2019-01-01', 'predict': '2'}
  {'confirm': '1', 'state': 'MA\n', 'time': '2019-01-01', 'predict': '1'}
  {'confirm': '3', 'state': 'MA\n', 'time': '2019-01-01', 'predict': '3'}
  </code></pre>
  <p>I am just wondering how do I reform them so that it can look like the data I want.(By using python)
  Thank you very much for your helps!! I really appreciate it.</p>