How to keep the sequence of random numbers (normal distributions) the same? I tried random.seed(), but it didn't work
I’m trying to write some replicable Monte Carlo simulation, and need to fix the seed for the random number generator (so that when other people run it, they get exactly the same result).
I tried the following codes
import numpy as np import random random.seed(1) N=10 mu= sig=[] a=np.random.multivariate_normal(mu, sig, N) print(a)
But each time I run the code, it prints a different sequence. How could this be fixed? Thanks!
np.random aren’t the same. If you use
np.random then use
Answered By – Julien