Why is `random.seed()` not shuffling deterministically?

Viewed 23

I have the following code:

import numpy as np
np.random.seed(500)
x = np.array([1,2,3,4,5])
np.random.shuffle(x)
x

np.random.seed(500)
np.random.shuffle(x)
x

Even though the seed is reset in each, the shuffled array is different each time. Why is this the case?

0 Answers
Related