mercredi 25 novembre 2020

How to generate same random arrays while using np.random.normal()

X_p=np.random.normal(0,0.05,size=(100,2))
X_n=np.random.normal(0.13,0.02,size=(50,2))
plt.scatter(X_p[:,0],X_p[:,1])
plt.scatter(X_n[:,0],X_n[:,1],color='red')
plt.show()

this code generates different plot everytime we run it. Can someone tell me is there a way to generate same data always with given std and mean

enter image description here




Aucun commentaire:

Enregistrer un commentaire