Aug-12-2020, 12:51 AM
I didn't test it, but something like the following should help you:
L = 1000 data = np.random.rand(4064, 1) for j in range(data.shape[0] // L): mapper = np.memmap(f'map{j}.dat', dtype='float64', mode='w+', shape=(L,1)) mapper = data[j*L:j*L+L] if data.shape[0] % L != 0: mapper = np.memmap(f'map{j+1}.dat', dtype='float64', mode='w+', shape=(data.shape[0] % L,1)) mapper = data[j*L + L:]