[英]equivalent of using #include <Numeric/arrayobject.h> in Numpy
I have an old piece of code and it uses Numeric and I wanted to swap that with numpy. 我有一段旧代码,它使用Numeric,我想用numpy交换它。
There is some C code too that uses the following: 还有一些C代码使用以下内容:
#include <Numeric/arrayobject.h>
I want to do the same using Numpy, is there a way to do this? 我想用Numpy做同样的事情,有没有办法做到这一点?
So if anyone is interested -to continue to use arrayobject.h like in the old Numeric system 因此,如果有人有兴趣 - 继续使用像旧的数字系统中的arrayobject.h
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: 但是新的arrayobject.h与Numeric位于不同的位置,因此请更新setup.py,如下所示:
add the following 添加以下内容
import numpy as NU
Then under setup (still in setup.py) add the following 然后在setup下(仍然在setup.py中)添加以下内容
include_dirs = [NU.get_include()],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.