5 Feb
2006
5 Feb
'06
2:41 p.m.
Jeff Whitaker wrote:
Hi: I've successfully used the examples at http://www.scipy.org/Wiki/Cookbook/Pyrex_and_NumPy to access the data in a 'normal' numpy array, but have had no success adapting these examples to work with object arrays. I understand that the .data attribute holds pointers to the objects which actually contain the data in an object array, but how to you use those pointers to get the data in C/pyrex?
You have a pointer to a PyObject *object in the data. Thus, data should be recast to PyObject **. I don't know how to do that in PyRex. But, it's easy in C. In C, you will need to be concerned about reference counts. I don't know how pyrex handles this.