Skip to content

Instantly share code, notes, and snippets.

View qxf2's full-sized avatar

Qxf2 Services qxf2

View GitHub Profile
@qxf2
qxf2 / grouping_people.py
Last active May 4, 2020 10:57
This script is an example of how to pick groups of 'r' people randomly from within a larger sample of N people such that no single person appears in two groups.
"""
This script is an example of how to pick groups of 'r' people randomly from within a larger sample of N people such that no single person appears in two groups.
I find this script useful when I have to divide my employees into groups randomly
"""
import argparse
import itertools
import random
#Note: Listing employees just to keep the example short
#You would (ideally) get a list of employees from some central datastore