简体   繁体   English

相当于使用#include <Numeric/arrayobject.h> 在Numpy

[英]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.

相关问题 致命错误:numpy/arrayobject.h:google colab 中没有这样的文件或目录#include“numpy/arrayobject.h” - fatal error: numpy/arrayobject.h: No such file or directory #include "numpy/arrayobject.h" in google colab 将 numpy 的 arrayobject.h 包含到 bitbake 配方中 - 如何修复安装顺序? - Include numpy's arrayobject.h into bitbake recipe - how to fix installation order? Cython:致命错误:未找到“numpy/arrayobject.h”文件,使用 numpy - Cython: fatal error: 'numpy/arrayobject.h' file not found, using numpy 包括<arrayobject.h>使用 cibuildwheels 在构建管道中编译 C python 扩展的标头路径 - Include <arrayobject.h> header path to compile C python extension in build pipeline using cibuildwheels 如何使用C将数据从np.array获取到std :: vector <numpy/arrayobject.h> ? - How to get data from np.array to std::vector in c++ using <numpy/arrayobject.h>? Cython:“致命错误:numpy/arrayobject.h:没有这样的文件或目录” - Cython: "fatal error: numpy/arrayobject.h: No such file or directory" 编译.pyx文件时缺少numpy / arrayobject.h - Missing numpy/arrayobject.h while compiling .pyx file cimport给出致命错误:找不到“ numpy / arrayobject.h”文件 - cimport gives fatal error: 'numpy/arrayobject.h' file not found 致命错误:numpy / arrayobject.h:没有这样的文件或目录 - fatal error: numpy/arrayobject.h: No such file or directory 致命错误:使用 pyenv 时找不到“arrayobject.h”文件 - fatal error: 'arrayobject.h' file not found when using pyenv
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM