[Numpy-discussion] Possible roadmap addendum: building better text file readers
Mon Feb 27 09:10:38 CST 2012
I have a few features that I believe would make text file easier for many people. In some countries (most?) the decimal separator in real numbers is not a point but a comma.
I think it would be very useful that the decimal separator be specified with a keyword argument (decimal = '.' for example) on the text reading function. There are workarounds such as previously replacing dots with commas, changing the locale (which is usually a messy solution) but it is always very annoying. I often use rpy to call R's functions read.table or scan to read text files.
I have been meaning to write "improved" functions to read text files but lately I find it much simpler to use rpy. Another thing that is very useful is the ability to read a predetermined number of lines from the file. As of right now loadtxt and genfromtxt both read the entire file AFAICT.
De: Jay Bourque <email@example.com>
Enviadas: Segunda-feira, 27 de Fevereiro de 2012 2:24
Assunto: Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers
Erin Sheldon <erin.sheldon <at> gmail.com> writes:
> Excerpts from Wes McKinney's message of Sat Feb 25 15:49:37 -0500 2012:
> > That may work-- I haven't taken a look at the code but it is probably
> > a good starting point. We could create a new repo on the pydata GitHub
> > org (http://github.com/pydata) and use that as our point of
> > collaboration. I will hopefully be able to put some serious energy
> > into this this spring.
> First I want to make sure that we are not duplicating effort of the
> person Travis mentioned.
> Logistically, I think it is probably easier to just fork numpy into my
> github account and then work it directly into the code base, and ask for
> a pull request when things are ready.
> I expect I could have something with all the required features ready in
> a week or so. It is mainly just porting the code from C++ to C, and
> writing the interfaces by hand instead of with swig; I've got plenty of
> experience with that, so it should be straightforward.
I'm the one Travis mentioned earlier about working on this. I was planning on
diving into it this week, but it sounds like you may have some code already that
fits the requirements? If so, I would be available to help you with
porting/testing your code with numpy, or I can take what you have and build on
it in my numpy fork on github.
NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion