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

2012-10-31 Thread Chris Barker
On Mon, Oct 29, 2012 at 1:37 PM, David Warde-Farley wrote: > This is something of a hack. but a cool one... > Like Pauli said, it's probably worthwhile to consider HDF5. But HDF5 is a big dependency -- it can be a pain to build. IT's great for what it does well, and great for interchanging dat

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() > > O

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 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() >

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

2012-10-29 Thread Pauli Virtanen
Radek Machulka 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 maybe? I

[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 ca