SyntaxFix
Write A Post
Hire A Developer
Questions
Maybe it is kind of late. But you can use numpy.random.choice(), passing the p parameter:
numpy.random.choice()
p
val = numpy.random.choice(numpy.arange(1, 7), p=[0.1, 0.05, 0.05, 0.2, 0.4, 0.2])