I\'m using functions from numpy.random
on a Jupyter Lab notebook and I\'m trying to set the seed using numpy.random.seed(333)
. This works as expect
Because you run np.random.choice()
in the cells different from np.random.seed()
. Try to run np.random.seed()
and np.random.choice()
in the same cell, you'll get same number.
# in [11]
import numpy as np
# even if I set the seed here the other cells don't see it
np.random.seed(333)
np.random.choice([1,23,44,3,2])
2
# gets the same numbers
# in [12]
import numpy as np
# even if I set the seed here the other cells don't see it
np.random.seed(333)
np.random.choice([1,23,44,3,2])
2
# gets the same numbers