title: Pandas dataframe total row
body: <p>I have a dataframe, something like:</p>
  <pre><code>     foo  bar  qux
  0    a    1    3.14
  1    b    3    2.72
  2    c    2    1.62
  3    d    9    1.41
  4    e    3    0.58
  </code></pre>
  <p>and I would like to add a 'total' row to the end of dataframe:</p>
  <pre><code>     foo  bar  qux
  0    a    1    3.14
  1    b    3    2.72
  2    c    2    1.62
  3    d    9    1.41
  4    e    3    0.58
  5  total  18   9.47
  </code></pre>
  <p>I've tried to use the <code>sum</code> command but I end up with a Series, which although I can convert back to a Dataframe, doesn't maintain the data types:</p>
  <pre><code>tot_row = pd.DataFrame(df.sum()).T
  tot_row['foo'] = 'tot'
  tot_row.dtypes:
       foo    object
       bar    object
       qux    object
  </code></pre>
  <p>I would like to maintain the data types from the original data frame as I need to apply other operations to the total row, something like:</p>
  <pre><code>baz = 2*tot_row['qux'] + 3*tot_row['bar']
  </code></pre>