"using pandas, how do i subsample a large dataframe by group in an efficient manner?",subsampled = df.ix[(choice(x) for x in list(grouped.groups.values()))]