问题
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