[Numpy-discussion] use of the PyArray_SETITEM numpy method

Francesc Alted faltet@pytables....
Wed Dec 22 04:11:17 CST 2010


A Wednesday 22 December 2010 10:55:30 Michel Dupront escrigué:
> Hello,
> 
> Please somebody help me !
> 
> I am really confused with all these void that I see everywhere.
> 
> The documentation says:
> PyObject * PyArray_SETITEM(PyObject * arr, void* itemptr, PyObject*
> obj)
> 
> I created a 1D array of doubles with PyArray_SimpleNew.
> Now I am in a loop of index i to feed my array with values.
> What should I give for itemptr ?

The pointer to your data indeed.  For example, if you declare your item 
as:

double myitem

then, pass it as &myitem.

-- 
Francesc Alted


More information about the NumPy-Discussion mailing list