jeudi 1 août 2019

Is there a way to provide probability to numpy.random.uniform?

I am currently using the numpy.random.uniform function to generate random decimals within a certain range.

x = np.random.uniform(-5, 5, (1, 2))

However, I want to add a probability for a certain random value to occur. I know the np.random.choicefunction has it, but I want to produce decimals, not whole numbers. Is there a way to generate random decimals and give them probabilities?




Aucun commentaire:

Enregistrer un commentaire