use of the PyArray_SETITEM numpy method

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 ? Thank you

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
participants (2)
-
Francesc Alted
-
Michel Dupront