title: Pandas Dataframe - Turn Columns To Rows Sorted by "Grand Totals" Row
body: <p>I have data in a dataframe that looks like this, where each column is a KEYWORD and each row is an observation of how many times each ID said the word:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">id</th>
  <th style="text-align: center;">bagel</th>
  <th style="text-align: center;">pizza</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">ABC</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: center;">3</td>
  </tr>
  <tr>
  <td style="text-align: center;">DEF</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">3</td>
  </tr>
  <tr>
  <td style="text-align: center;">GHI</td>
  <td style="text-align: center;">7</td>
  <td style="text-align: center;">9</td>
  </tr>
  <tr>
  <td style="text-align: center;">TOTAL</td>
  <td style="text-align: center;">10</td>
  <td style="text-align: center;">15</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am trying to get it to a form where I can see what the most popular word is overall, something where the columns themselves are new columns and the TOTAL row transforms to a column that can be sorted:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Column</th>
  <th>Total</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>bagel</td>
  <td>10</td>
  </tr>
  <tr>
  <td>pizza</td>
  <td>15</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I have tried <code>melt</code> and <code>stack</code> but I dont think I am using either one correctly. Any help is appreciated.</p>