Create your own instance of numpy.random.RandomState() with the seed of your choice. Do not use numpy.random.seed() , except for working with inflexible libraries that do not allow you to pass your own instance of RandomState .
[~] |1> from numpy.random import RandomState [~] |2> prng = RandomState(1234567890) [~] |3> prng.randint(-1, 2, size=10) array([ 1, 1, -1, 0, 0, -1, 1, 0, -1, -1]) [~] |4> prng2 = RandomState(1234567890) [~] |5> prng2.randint(-1, 2, size=10) array([ 1, 1, -1, 0, 0, -1, 1, 0, -1, -1])
Robert Kern Apr 29 2018-11-21T00: 00Z
source share