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

2012-10-30 Thread Paul Anton Letnes
On 29. okt. 2012, at 11:29, Radek Machulka wrote: Hi, 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) fw.close() Or some

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

2012-10-29 Thread Radek Machulka
Hi, 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) fw.close() Or some workaround maybe? I go through hundreds of thousands arrays and

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

2012-10-29 Thread Pauli Virtanen
Radek Machulka radek.machulka at gmail.com writes: 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) fw.close() Or some workaround

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

2012-10-29 Thread David Warde-Farley
On Mon, Oct 29, 2012 at 6:29 AM, Radek Machulka radek.machu...@gmail.com wrote: Hi, 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)