Is there some way to make the random number generator in numpy generate the same random numbers as in Matlab, given the same seed?
I tried the following in Matlab:>
As Bakuriu suggest it works using MATLABs twister:
MATLAB:
>> rand('twister', 1337) >> rand() ans = 0.2620
Python (Numpy):
>>> import numpy as np >>> np.random.seed(1337) >>> np.random.random() 0.2620246750155817