• No products in the cart.

Can we form a group for Assignment 1 Day 1?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3639

    Can we form a group for Assignment 1 Day 1?

    #3654

    uday
    Participant

    Tried creating random groups :D. Feel free to play around and make sure you change the seed for new random groups. 

    import numpy as np

    np.random.seed(42)

    a = []

    groups = []

    for r in range(24):

      a.append(r+1)

    while(len(a) > 4):

      group = np.random.choice(a, size=4, replace=False)

      groups.append(group)

      for member in group:

        a.remove(member)

    print(groups)

    print(a)

    print(‘Done!!’)

    Groups

    [

    array([ 9, 17,  1, 19]), 

    array([22,  3,  7,  2]), 

    array([16, 13,  4,  6]), 

    array([24, 23, 12, 15]), 

    array([ 5, 10, 14, 18])

    ]

    [8, 11, 20, 21]

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
top
Managed by Ernesto.net © 2021. All rights reserved.