Created
February 2, 2020 15:54
-
-
Save blewert/d9074ab61b1cb9cfe120bbdb91980bd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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