[Numpy-discussion] numpy.savez(_compressed) in loop

Radek Machulka radek.machulka at gmail.com
Mon Oct 29 06:29:10 EDT 2012


is there a way how to save more arrays into single npy (npz if possible) file 
in loop? Something like:

fw = open('foo.bar', 'wb')
while foo:
	arr = np.array(bar)
	np.savez_compressed(fw, arr)

Or some workaround maybe? I go through hundreds of thousands arrays and can 
not keep them in memory. Yes, I can save each array into single file, but I 
would better have them all in single one.


More information about the NumPy-Discussion mailing list