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

Pierre GM pgmdevlist@gmail....
Mon Dec 1 13:42:27 CST 2008


On Dec 1, 2008, at 2:26 PM, John Hunter wrote
>
> OK, that worked great.  I do think some a default impl in np.rec which
> returned a recarray would be nice.  It might also be nice to have a
> method like np.rec.fromcsv which defaults to a delimiter=',',
> names=True and dtype=None.  Since csv is one of the most common data
> interchange format in  the world, it would be nice to have some
> obvious function that works with it with little or no customization
> required.


Quite agreed. Personally, I'd ditch the default dtype=float in favor  
of dtype=None, but compatibility is an issue.
However, if we all agree on genloadtxt, we can use tailored-made  
version in different modules, like you suggest.

There's an extra issue for which we have an solution I'm not  
completely satisfied with: names=True.
It might be simpler for basic user not to set names=True, and have the  
first header recognized as names or not if needed (by processing the  
first line after the others, and using it as header if it's found to  
be a list of names, or inserting it back at the beginning otherwise)...


More information about the Numpy-discussion mailing list