Numeric - writing extentions

Tom Loredo loredo at astro.cornell.edu
Fri Jan 18 18:49:45 EST 2002


Hi Jesper-

I do this kind of thing a lot.  Perhaps the problem is the cast.
I have stolen some macros from the Numeric source to do the casts.
For example, this is the one I use for an array of doubles:

/* Macro to cast NumPy array data to a 1-d double array. */
#define DDATA(p) ((double *) (((PyArrayObject *)p)->data))

May be worth a try....

Good luck,
Tom Loredo



More information about the Python-list mailing list