title: Looping over groups in a grouped dataframe
body: <p>Consider this small example:</p>
  
  <pre><code>data={"X":[1, 2, 3, 4, 5], "Y":[6, 7, 8, 9, 10], "Z": [11, 12, 13, 14, 15])
  frame=pd.DataFrame(data,columns=["X","Y","Z"],index=["A","A","A","B","B"])
  </code></pre>
  
  <p>I want to group <code>frame</code> with</p>
  
  <pre><code>grouped=frame.groupby(frame.index)
  </code></pre>
  
  <p>Then I want to loop over the groups by:</p>
  
  <pre><code>for group in grouped:
  </code></pre>
  
  <p>But I'm stuck on the next step: How can I extract the <code>group</code> in each loop as a pandas DataFrame so I can further process it?</p>