I am trying to generate 100 random column stochastic matrices using a for loop and save them.
Below code is to generate an individual random column stochastic matrix.
import numpy as np
import random
For x in range(100):
a = 2
sto = np.identity(2)
sto = sto + np.random.uniform(low=0.2, high=0.5, size=(a, a))
sto = sto / sto.sum(axis=0, keepdims=1)
print(sto)
When I try to implement the operation to generate 100 matrices with a for loop I fail - all matrices generated turn out to be the same.
Edit: I can now generate different matrices in the loop.
But I still don't know how to save them all to use in later work (for instance: saving them to multiply some of them at a later step)?