title: Python Pandas sub-totals and grand total
body: <p>I have the following table:</p>
  
  <p><img src="https://i.stack.imgur.com/lez9i.jpg" alt="enter image description here"></p>
  
  <p>How do I either break out the table so that it only has the headers:</p>
  
  <p><strong>Peat-Forming, PBL_AWI, CM, LBH</strong></p>
  
  <p>and the values remain the same as shown? Doing this I believe would make it possible to add sub-totals and grand totals to the data.</p>
  
  <p>Alternatively how do I add Sub-totals to 'Peat-Forming' with a 'Grand Total' at the end?</p>
  
  <p><a href="https://stackoverflow.com/questions/20824306/pivot-a-pandas-dataframe-and-get-the-non-axis-columns-as-a-series">I tired doing this yet can't get to work because of multi-indexs</a> </p>