title: How to retrieve rows of a Pandas GroupBy object in for loop
body: <p>I have a group by object.I want to retrieve rows of a particular column of the group by object in for loop &amp; do some processing. For example,I'm giving here a sample code for group by object</p>
  
  <pre><code>df = pd.DataFrame({'A' : ['foo', 'bar', 'foo', 'bar',
                               'foo', 'bar', 'foo', 'foo'],
                         'B' : ['one', 'one', 'two', 'three',
                                'two', 'two', 'one', 'three'],
                         'C' : np.random.randn(8),
                         'D' : np.random.randn(8)})
  grouped = df.groupby(['A', 'B'])
  </code></pre>
  
  <p>After group by, I got following object</p>
  
  <p><a href="https://i.stack.imgur.com/9UdmY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9UdmY.png" alt="enter image description here"></a></p>
  
  <p>In a for loop I would like to do some check if it's one,two or three &amp; then do some processing.Can you please suggest me the steps?</p>