title: Multi column join in pandas from groupby
body: <p>I have a large dataframe and a small dataframe that I would like to join together.  The small dataframe holds the maximum weekly value corresponding to the range of values in the larger dataframe by group. I want to join the maximum value per week per group to the large frame.</p>
  
  <p>large frame:</p>
  
  <pre><code>L
  datetime     group    value
  2014-05-07   A        3 
  2014-05-07   B        3 
  2014-05-14   A        4 
  2014-05-14   B        2 
  2014-05-15   A        6 
  2014-05-15   B        4 
  2014-05-16   A        7 
  2014-05-16   B        10
  </code></pre>
  
  <p>small frame:</p>
  
  <pre><code>S
  weeknumber   group    maxval
  1            A        3
  1            B        3
  2            A        7
  2            B        10
  </code></pre>
  
  <p>Note these are hypothetical week values, the actual values will correspond to the week number in the year, out of 52.</p>
  
  <p>To calculate the small frame, we can set an index on our datetime:</p>
  
  <pre><code>import pandas as pd
  L.index = pd.to_datetime(L.datetime)
  </code></pre>
  
  <p>We can group by groups and week like so:</p>
  
  <pre><code>week = L.groupby([(lambda x : x.week),'group'], as_index=False)
  </code></pre>
  
  <p>Calculating the weekly max is simple:</p>
  
  <pre><code>weekmax = week.value.max()
  </code></pre>
  
  <p>This returns the small frame and is where I get stuck.  I have tried merging the dataframes and performing joins but can't get it to work.</p>
  
  <p>EDIT:
  This is what I want the final frame to look like after the join:</p>
  
  <pre><code>datetime     group    value    maxval
  2014-05-07   A        3        3
  2014-05-07   B        3        3
  2014-05-14   A        4        7
  2014-05-14   B        2        10
  2014-05-15   A        6        7
  2014-05-15   B        4        10
  2014-05-16   A        7        7
  2014-05-16   B        10       10
  </code></pre>