Skip to content

Instantly share code, notes, and snippets.

@blewert
Created February 2, 2020 15:54
Show Gist options
  • Save blewert/d9074ab61b1cb9cfe120bbdb91980bd1 to your computer and use it in GitHub Desktop.
Save blewert/d9074ab61b1cb9cfe120bbdb91980bd1 to your computer and use it in GitHub Desktop.
from math import floor
def assign_equal_groups(sample_size, num_groups):
return_list = [];
group_size = sample_size / num_groups;
for i in range(0, sample_size):
v = (i / group_size) % num_groups;
return_list.append(floor(v));
return return_list;
print(assign_equal_groups(50, 10));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment