Probability distribution in Python

后端 未结 12 2064
误落风尘
误落风尘 2020-12-02 08:12

I have a bunch of keys that each have an unlikeliness variable. I want to randomly choose one of these keys, yet I want it to be more unlikely for unlikely (key, values) to

12条回答
  •  悲&欢浪女
    2020-12-02 08:50

    (A year later) Walker's alias method for random objects with different probablities is very fast and very simple

提交回复
热议问题