title: Including the group name in the apply function pandas python
body: <p>Is there away to specify to the <code>groupby()</code> call to use the group name in the <code>apply()</code> lambda function?</p>
  
  <p>Similar to  if I iterate through groups I can get the group key via the following tuple decomposition:</p>
  
  <pre><code>for group_name, subdf in temp_dataframe.groupby(level=0, axis=0):
      print group_name
  </code></pre>
  
  <p>...is there a way to also get the group name in the apply function, such as:</p>
  
  <pre><code>temp_dataframe.groupby(level=0,axis=0).apply(lambda group_name, subdf: foo(group_name, subdf)
  </code></pre>
  
  <p>How can I get the group name as an argument for the apply lambda function?</p>