lundi 14 juin 2021

-python- Random Choice with Probability

If there is a dictionary like {1:9.384,2:87.284,3:3.332}, is there a module or source that randomly selects by applying probability? I've tried to create a module by changing the probability to an integer, but it's too slow, and repeated actions sometimes lead to errors. I need your help.




Aucun commentaire:

Enregistrer un commentaire