title: Converting dataframe to json
body: <p>i want to transform following dataframe</p>
  <pre><code>| id  | date         | score |
  | --- | ------------ | ----- |
  | 1   | 2021-01-01   | 1     |
  | 1   | 2021-01-02   | 2     |
  | 1   | 2021-01-03   | 3     |
  </code></pre>
  <p>into json of following format</p>
  <p><code>[{id: 1}, {date: 2021-01-01, score: 1}, {date: 2021-01-02, score: 2}, {date: 2021-01-03, score: 3}]</code></p>
  <p>I've tried using <code>to_json(orient='records')</code> but that would produce:</p>
  <p><code>[{id: 1, date: 2021-01-01, score: 1}, {id: 1, date: 2021-01-02, score: 2}, {id: 1, date: 2021-01-03, score: 3}]</code></p>
  <p>Is there some pre-processing to do before <code>to_json()</code> that will help get my output or should i manually create key value pairs ?</p>
  <h4>NOTE</h4>
  <p>There won't be more than one id.</p>