I have looked around, but could not find an exact answer.

I have several matrices of 1200x2000 that I want to save in a way that I can read them later in some sort of loop. When I want to save 100 of these matrices using the method below, the process is really fast. But if I want to save 1000, the time necessary for each iteration gets really long.

Here is an example of the problem (here the matrices are only 1s because the problem already appears in this simple case):

```
reps = 1000
ret100 = np.zeros([1200, 2000, reps])
for k in range(reps):
    ret100[:,:,k] = 1
    print(k)

```

compared to the same thing, but reps=100:

```
reps = 100
ret100 = np.zeros([1200, 2000, reps])
for k in range(reps):
    ret100[:,:,k] = 1
    print(k)

```

I have two questions:

1. Why does each step in the iteration above take longer when reps = 1000, compared to 100? Is this the expected behavior?
2. Is there a better way to store a bunch of matrices than one presented above?