How to generate same random array given a range with probability in python

后端 未结 0 803
时光取名叫无心
时光取名叫无心 2021-01-25 20:10

So basically I want to generate a 300-elements array given a range [5,6,7,8,9] with according probability [0.1,0.1,0.4,0.3,0.1]. So for example, the probability to get 5 is 0.1.

相关标签:
回答
  • 消灭零回复
提交回复
热议问题