I have several large tables.carray
data structures of the same shape (300000x300000). I want to add all the data and store it in a master matrix.
Right now, I create a new carray and fill it with a simple loop:
shape = (300000,300000)
#... open all hdf5 files of the existing matrices and create a new one
matrix = h5f.createCArray( h5f.root, 'carray', atom, shape, filters=filters )
for i in range( shape[0] ):
for j in range( shape[1] ):
for m in single_matrices:
# print 'reading', i,j,shape
value = m[i, j]
# print 'writing'
matrix[i, j] += value
But it is very slow (>12 hours). Is there a better way?