equivalent of using #include <Numeric/arrayobject.h> in Numpy

血红的双手。 提交于 2019-12-13 18:50:54

问题


I have an old piece of code and it uses Numeric and I wanted to swap that with numpy.

There is some C code too that uses the following:

    #include <Numeric/arrayobject.h>

I want to do the same using Numpy, is there a way to do this?


回答1:


So if anyone is interested -to continue to use arrayobject.h like in the old Numeric system

do the following:

      Replace <Numeric/arrayobject.h> with <numpy/arrayobject.h>

But the new arrayobject.h is in a different location to Numeric so update the setup.py as follows:

add the following

     import numpy as NU

Then under setup (still in setup.py) add the following

    include_dirs = [NU.get_include()], 


来源:https://stackoverflow.com/questions/19236121/equivalent-of-using-include-numeric-arrayobject-h-in-numpy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!