title: pandas groupby aggregate with grand total in the bottom
body: <p>Here is my code:</p>
  
  <pre><code>import StringIO
  from pandas import *
  import numpy as np
  
  df = read_csv(StringIO.StringIO('''Col1 Col2    A   B
  A   D   1   6
  A   E   2   7
  B   D   3   8
  B   E   4   9
  C   D   5   19'''), delimiter='\t')
  
  
  df['buc1'] = cut(df['A'], bins = [0, 2, 6, 8])
  
  aggFunc = {'A': sum,
             'B': np.average
             }
  </code></pre>
  
  <p>After running:</p>
  
  <pre><code>df.groupby(['buc1']).agg(aggFunc)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>         A     B
  buc1            
  (0, 2]   3   6.5
  (2, 6]  12  12.0
  (6, 8] NaN   NaN
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How do I get rid of the bottom (6, 8] bucket, given that there are no values there?</li>
  <li>How do I add a grand total row at the bottom, as in a pivot table in Excel?</li>
  </ol>
  
  <p>For instance:</p>
  
  <pre><code>buc1    A   B
  (0, 2]  3   6.5
  (2, 6]  12  12
  Total   15  9.8
  </code></pre>
  
  <p>Note that the total row for the second column would be the average, not the sum.</p>