Question: python program using random.sample Practice with using Radom module. . Write a function, named generateValues, to partition a list of samples into two equally-sized groups:

 python program using random.sample Practice with using Radom module. . Write

python program using random.sample

Practice with using Radom module. . Write a function, named generateValues, to partition a list of samples into two equally-sized groups: experimental group and control group. It accepts a list of strings as argument, representing names of examinees sampled from some population. Assume all sampled examinees' names are unique. Your function should return two lists of strings, representing experimental and control groups. In other words, the function shall randomly choose half of the passed-in list into experimental group and the rest will be assigned to control group. Every name in the passed-in list must be either in experimental group or in control group. The function generateValues aggregates the generated integers into a list and returns it. For example, suppose the variable patients is defined to be ['Jackson", "Aiden", "Liam", "Noah", "Lucas, "Sophia", "Emma", "Olivia", "Ava", "Mia"], the function call of ab_testing(patients) may result in the following two groups: Experiment group: [Emma', Liam, Noah', Mia', Sophia] Control group: ['Jackson', 'Aiden', Lucas', Olivia, 'Ava]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!