[Numpy-discussion] Troubles with arrays

Travis Oliphant oliphant.travis at ieee.org
Fri Jul 27 08:55:04 CDT 2001


On Fri, 27 Jul 2001, Paul F. Dubois wrote:
> I don't know if someone helped you with this while I was on travel, but in
> case they didn't:
>

I tested his code on my machine and found that by placing an import_array()
statement in the subroutine which uses the C-API seems to work.

> I'm pretty sure your problem is that myTest is not in the same file as the
> import_array; when it tries to access the Numeric C API, it will be
> dereferencing zero. For extensions that are not in one file, a special
> techniques is required. Recently an improvement was added to make this
> easier. I believe you should add this to your header file, above the
> include of arrayobject.h:

>
> #define PY_ARRAY_UNIQUE_SYMBOL xxxx
>
> where xxxx is any name you choose that won't conflict with your other
> stuff.
>





More information about the Numpy-discussion mailing list