I'm a python user for scientific computation. Now, I have some numpy arrays, and the size of each of them is huge. Thus, I can not short all of them in the memory at the same time. I want to save the arrays in the disk and read them one by one at each time to do some calculation. How to perform this process pythonicly?
I know if all the data are stored in the memory, I can create a list named array_list like this:
array_list = []
for i0 in range(n_array):
t_ayyay = do_some_calculate()
array_list.append(t_ayyay)
and when I want to use them:
for i0 in range(n_array):
t_ayyay = array_list[i0]
# do something.
How to save array_list in the disk, and I can read each object using the index without load all of them in the memory?
Thanks.
h5pyandnp.savezsave multiple arrays 'by-name'. In other words, you access them by name, as though they were values in a dictionary.