Reputation: 1479
I want to create new matrix (V) with fixed random value in each position (every time I run algorithm, I want to have this same matrix showing up). Is it possible to use np.random.seed() for matrix? Something like
V = np.zeros([20,50])
V = np.random.seed(V)
Upvotes: 0
Views: 2093
Reputation: 15071
use this to set the seed:
np.random.seed(0) # or whatever value you fancy
and then generate your random data:
V = np.random.rand(your_shape) # or whatever randomness you fancy like randint, randn ...
Upvotes: 4