title: pandas dataframe groupby and get nth row
body: <p>I have a pandas DataFrame like following.</p>
  
  <pre><code>df = pd.DataFrame([[1.1, 1.1, 1.1, 2.6, 2.5, 3.4,2.6,2.6,3.4,3.4,2.6,1.1,1.1,3.3], list('AAABBBBABCBDDD'), [1.1, 1.7, 2.5, 2.6, 3.3, 3.8,4.0,4.2,4.3,4.5,4.6,4.7,4.7,4.8], ['x/y/z','x/y','x/y/z/n','x/u','x','x/u/v','x/y/z','x','x/u/v/b','-','x/y','x/y/z','x','x/u/v/w'],['1','3','3','2','4','2','5','3','6','3','5','1','1','1'],['200','400','404','200','200','404','200','404','500','200','500','200','200','400']]).T
  
  df.columns = ['col1','col2','col3','col4','ID','col5']
  </code></pre>
  
  <p>I want group this by "ID" and get the 2nd row of each group. Later I will need to get 3rd and 4th also. Just explain me how to get only the 2nd row of each group.</p>
  
  <p>I tried following which gives both first and second.</p>
  
  <pre><code>df.groupby('ID').head(2)
  </code></pre>
  
  <p>Instead I need to get only the second row. Since ID 4 and 6 has no second rows need to ignore them. </p>
  
  <pre><code>             col1 col2 col3     col4     ID    col5
  ID                                           
  1       0   1.1     A  1.1    x/y/z       1    200
          11  1.1     D  4.7    x/y/z       1    200
  2       3   2.6     B  2.6      x/u       2    200
          5   3.4     B  3.8    x/u/v       2    404
  3       1   1.1     A  1.7      x/y       3    400
          2   1.1     A  2.5  x/y/z/n       3    404
  4       4   2.5     B  3.3        x       4    200
  5       6   2.6     B    4    x/y/z       5    200
          10  2.6     B  4.6      x/y       5    500
  6       8   3.4     B  4.3  x/u/v/b       6    500
  </code></pre>