dimanche 25 octobre 2020

Normal Random Distribution with Random State [closed]

I am trying to generate a random distribution with a random state where all the generated values are positive. The code I am using is:

ran_state = 8
n = 10
average = 3
std = 2
random_generator = np.random.default_rng(ran_state)
normal = random_generator.normal(loc = average, scale = std, size = n)

However some values I am obtaining are negativas:

array([-0.4765328 , 0.32671441, 0.27778658, 2.29676574, -1.62516316, 2.62220561, 1.08554154, 4.78720037, 4.91369448, 5.78451646])

How can I do to obtain only positive values?

Can anyone help me?

Regards




Aucun commentaire:

Enregistrer un commentaire