title: cumsum per group in column ordered by second column append to original dataframe
body: <p>I have a dataframe of 2 columns with multiple groups, in this case, column 1 with groups, and column 2 groups, (in this case dates which must be in correct order).   I want a cumulative summation of the third column per each unique group in col1 ordered by col2.  </p>
  
  <p>I have yet to find an elegant method to accomplish this.  The following code will correctly accomplish the task, but sums the whole table, and is very dependent on getting all of the sorts correct. </p>
  
  <p><code>multidf = df.groupby(by=['col1','col2']).sum().groupby(level=[0]).cumsum()</code>
  Will give a hierarchical index solution, but I could not find a way to take the resulting cumulative sum column and attach it to the original dataframe without multistep merge commands.  The reset_index command just converts the table back to its original state. </p>
  
  <p>Looking for a better method to achieve desired output as shown.  I have messed with lambda, apply, aggregrate commands can't quite get anything to work.  </p>
  
  <pre><code>In[229]: df#example dataframe
  Out[229]: 
    col1                 col2  col3
  0    a  2013/01/03 00:00:00     1
  1    a  2013/03/05 09:43:31     3
  2    b  2013/03/07 00:00:00     4
  3    b  2013/03/07 00:00:00     2
  4    a  2013/03/07 00:00:00     0
  
  import numpy as np
  import pandas as pd
  ##example dataframe
  df = pd.DataFrame({'col1' : ['a','a','b','b','a'],
                 'col2' : ['2013/01/03 00:00:00', '2013/03/05 09:43:31', '2013/03/07 00:00:00',\
                           '2013/03/07 00:00:00', '2013/03/07 00:00:00'],
                 'col3' : [1,3,4,2,0]})
  df = df.sort(['col1','col2'])
  jj= df.groupby(by = ['col1'],sort=['col1','col2']).cumsum()
  
  df = df.sort(['col1','col2'])
  
  ##multi alternative, can't get result back into original df elegantly
  multidf = df.groupby(by=['col1','col2']).sum().groupby(level=[0]).cumsum()
  
  df['cumsum'] = jj['col3']
  In[227]: df ## result of unelegant method, desired output though how else can i achieve this?
  Out[227]: 
    col1                 col2  col3 cumsum
  0    a  2013/01/03 00:00:00     1      1
  1    a  2013/03/05 09:43:31     3      4
  4    a  2013/03/07 00:00:00     0      4
  2    b  2013/03/07 00:00:00     4      4
  3    b  2013/03/07 00:00:00     2      6
  </code></pre>