How about something like that ...
import numpy as np
This code will create the xfile.dat, yfile.dat, ect files that contain arrays in binary format. To access them later, you just need to do np.memmap(filename) . Other np.memmap arguments are optional but recommended (arguments such as dtype, shape, ect.).
source share