sample_groups function

Sample groups from a grouped dataset