[Numpy-discussion] reading gzip compressed files using numpy.fromfile

2009-10-29 Thread Peter Schmidtke
> Date: Wed, 28 Oct 2009 20:31:43 +0100 > From: Peter Schmidtke > Subject: [Numpy-discussion] reading gzip compressed files using > numpy.fromfile > To: numpy-discussion@scipy.org > Message-ID: > Content-Type: text/plain; charset="UTF-8" > > Dear Nump

Re: [Numpy-discussion] reading gzip compressed files using numpy.fromfile

2009-10-28 Thread Christopher Barker
Robert Kern wrote: >>f=gzip.open( "myfile.gz", "r" ) >> xyz=npy.fromfile(f,dtype="float32",count=400) > Read in reasonably-sized chunks of bytes at a time, and use > np.fromstring() to create arrays from them. Something like: count = 400 xyz = np.fromstring(f.read(count*4), dtype=np.floa

Re: [Numpy-discussion] reading gzip compressed files using numpy.fromfile

2009-10-28 Thread Robert Kern
On Wed, Oct 28, 2009 at 14:31, Peter Schmidtke wrote: > Dear Numpy Mailing List Readers, > > I have a quite simple problem, for what I did not find a solution for now. > I have a gzipped file lying around that has some numbers stored in it and I > want to read them into a numpy array as fast as po

[Numpy-discussion] reading gzip compressed files using numpy.fromfile

2009-10-28 Thread Peter Schmidtke
Dear Numpy Mailing List Readers, I have a quite simple problem, for what I did not find a solution for now. I have a gzipped file lying around that has some numbers stored in it and I want to read them into a numpy array as fast as possible but only a bunch of data at a time. So I would like to