Getting double* from NumPy array?

Alex cut_me_out at hotmail.com
Mon Jun 26 21:12:59 EDT 2000


> Assuming a 1-dimensional NumPy array, is there an easy way to extract a
> pointer to a double and length from the python object?  The C/C++ isn't
> going to change the object so I'd prefer not to make a copy of it.

Yeah, there is.  You probably want the numpy_array->data member.  See 

http://starship.python.net/crew/hinsen/NumPyExtensions.html

for a great overview of this sort of stuff.

Alex.



More information about the Python-list mailing list