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

Christopher Barker Chris.Barker@noaa....
Wed Dec 3 12:19:58 CST 2008


Alan G Isaac wrote:
> If I know my data is already clean
> and is handled nicely by the
> old loadtxt, will I be able to turn
> off and the special handling in
> order to retain the old load speed?

what I'd like to see is a version of loadtxt built on a slightly 
enhanced fromfile() -- that would be blazingly fast for the easy cases 
(simple tabular data of one dtype).

I don't know if the special-casing should be automatic, or just have it 
be a separate function.

Also, fromfile() needs some work, and it needs to be done in C, which is 
less fun, so who knows when it will get done.

As I think about it, maybe what I really want is a simple version of 
loadtxt written in C:

  It would only handle one data type at a time.
  It would support simple comment lines.
  It would only support one delimiter (plus newline).
  It would create a 2-d array from normal, tabular data.
  You could specify:
     how many numbers you wanted,
     or how many rows,
     or read 'till EOF

Actually, this is a lot like matlab's fscanf()

someday....

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the Numpy-discussion mailing list