vendredi 18 novembre 2022

Error while using numpy random.normalvariate()

I tried to generate random probs by using the following line code:

probs = [np.clip(random.normalvariate(0.1, 0.05), 0, 1) for x in range(1000)]

Unexpectedly I faced the following error message:

AttributeError: module 'numpy.random' has no attribute 'normalvariate'

Any idea how to solve this? I checked out the docs I find that this attribute exists in the numpy.random however it doesn't work when I used it in above code.

Any help to fix this issue will be appreciated.




Aucun commentaire:

Enregistrer un commentaire