[SciPy-dev] [SciPy-user] efficiently importing ascii data

Darren Dale dd55 at cornell.edu
Sat Nov 19 12:19:43 CST 2005


Hi Travis, All,

> > The other thing that needs to be done is that string (and unicode)
> > arrays need to convert to the numeric types, easily.  This would let you
> > read in a string array and convert to numeric types quite cleanly.
> > Right now, this doesn't work simply because the wrong generic functions
> > are getting called in the conversion routines.  This can and should be
> > changed, however.  The required code to change is in arraytypes.inc.src.
> >
> > I could see using PyInt_FromString, PyLong_FromString,
> > PyFloat_FromString, and calling the complex python function for
> > constructing complex numbers from a string.   Code would need to be
> > written to fully support Long double and complex long double conversion,
> > but initially they could just punt and use the double conversions.
> >
> > Alternatively, sscanf could be called when available for the type, and
> > the other approaches used when it isn't.
> >
> > Anybody want a nice simple project to get themselves up to speed with
> > the new code base :-)
>
> I'll look into it (after hours, just started a new job). I haven't worked
> much with C or wrapping C, and I need to learn sometime.

Now that I have studied the source, I'm not sure I am up to this. Between 
trying to learn C and wade through the (what appears to me) extremely 
abstracted source code, I might as well deciphering Linear A.

There wouldn't be, by chance, a developers guide to hacking scipy, would 
there?

Darren




More information about the Scipy-dev mailing list