Answers for "random sample with probability python"

0

random with probability python

import random

data = [1, 2, 3, 4, 5, 6]
probability = [0.3, 0.3, 0.1, 0.1, 0.1, 0.1]
 
random.choices(data, probability)
Posted by: Guest on May-04-2021

Code answers related to "random sample with probability python"

Python Answers by Framework

Browse Popular Code Answers by Language