Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
 
PREVIOUS NEXT
Tagged: #random #probability #python
ADD COMMENT
Topic
Name
9+2 =