title: How to convert pandas dataframe into nested dictionary or json?
body: <p>I am running Python 3.8 and Pandas 0.19.2 and have a DataFrame which looks as follows:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id_number</th>
  <th>name</th>
  <th>amount</th>
  <th>addenda</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1234</td>
  <td>ABCD</td>
  <td>$100</td>
  <td>Car-wash-$30</td>
  </tr>
  <tr>
  <td>1234</td>
  <td>ABCD</td>
  <td>$100</td>
  <td>Maintenance-$70</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I need a dictionary/JSON like below:</p>
  <pre><code>[
      {
         'id_number': 1234,
         'name': 'ABCD',
         'amount': '$100',
         'addenda': [ 
                    {'payment_related_info': 'Car-wash-$30'}, 
                    {'payment_related_info': 'Maintenance-$70'}
                    ]
      }
  ]
  </code></pre>
  <p>I tried using groupby and to_dict, but it did not work.
  Any suggestions? Thanks up front for the help.</p>