Including the group name in the apply function pandas python <p>Is there away to specify the groupby call to use the group name in the apply lambda function.</p> <p>For instance, 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 away to 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> <p>Thanks!</p>