[Numpy-discussion] np.loadtxt : yet a new implementation...

Ryan May rmay31@gmail....
Tue Dec 2 09:24:16 CST 2008

On Mon, Dec 1, 2008 at 4:55 PM, Pierre GM <pgmdevlist@gmail.com> wrote:

> On Dec 1, 2008, at 4:47 PM, Stéfan van der Walt wrote:
> >>
> > I haven't investigated the code in too much detail, but wouldn't it be
> > possible to implement the current set of functionality in a
> > base-class, which is then specialised to add the rest?  That way, one
> > could always instantiate TextReader yourself for some added speed.
> Well, one of the issues is that we need to keep the function
> compatible w/ urllib.urlretrieve (Ryan, am I right?), which means not
> being able to go back to the beginning of a file (no call to .seek).

Well, the original version of loadtxt() checked for seek but didn't need it
(fixed now), which kept me from using a urllib2.urlopen() object.  If
actually using seek() would speed up the new version of loadtxt(), feel free
to use it. I'm more than capable of wrapping the urlopen() object within a
StringIO.  However, I am unconvinced that removing the 2nd loop and instead
redoing the reading from the file will be much (if any) of a speed win.


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081202/b15bf98e/attachment.html 

More information about the Numpy-discussion mailing list