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

Christopher Barker Chris.Barker at noaa.gov
Wed Dec 3 12:48:16 EST 2008


Pierre GM wrote:
> I can try, but in that case, please write me a unittest, so that I  
> have a clear and unambiguous idea of what you expect.

fair enough, though I'm not sure when I'll have time to do it.

I do wonder if anyone else thinks it would be useful to have multiple 
delimiters as an option. I got the idea because with fromfile(), if you 
specify, say ',' as the delimiter, it won't use '\n', only  a comma, so 
there is no way to quickly read a whole bunch of comma delimited data like:

1,2,3,4
5,6,7,8
....

so I'd like to be able to say to use either ',' or '\n' as the delimiter.

However, if I understand loadtxt() correctly, it's handling the new 
lines separately anyway (to get a 2-d array), so this use case isn't an 
issue. So how likely is it that someone would have:

1  2  3, 4, 5
6  7  8, 8, 9

and want to read that into a single 2-d array?

I'm not sure I've seen it.

-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 at noaa.gov



More information about the NumPy-Discussion mailing list