pandas groupby apply
df1.groupby(['deal_name']).apply(np.sum).to_html('D:\test.html')

when apply functions to a groupby-ed dataframe, the html output is:

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>deal_name</th>
      <th>curr_bal</th>
      <th>orig_bal</th>
    </tr>
    <tr>
      <th>deal_name</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>RJ1410</th>
      <td> RJ1410RJ1410RJ1410RJ1410RJ1410RJ1410RJ1410RJ14...</td>
      <td> 12817608.5</td>
      <td> 13215877.1</td>
    </tr>
  </tbody>
</table>


the 2nd row is blank. is there a way to make it like this without reset_index making the dataframe flat? Potentially I need to group by two columns.

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th>deal_name</th>
      <th>deal_name</th>
      <th>curr_bal</th>
      <th>orig_bal</th>
  </thead>
  <tbody>
    <tr>
      <th>RJ1410</th>
      <td> RJ1410RJ1410RJ1410RJ1410RJ1410RJ1410RJ1410RJ14...</td>
      <td> 12817608.5</td>
      <td> 13215877.1</td>
    </tr>
  </tbody>
</table>

