pandas dataframe groupby and get nth row,df.groupby('ID').apply(lambda t: t.iloc[1])