Numeric Python and C
Simon Burton
simonb at NOTTHISBIT.webone.com.au
Wed Jan 14 19:46:29 EST 2004
On Wed, 14 Jan 2004 19:17:55 +0000, Ognen Duzlevski wrote:
> Hi,
> can someone explain how to change a value within an array from a C
> function?
>
What about using PyObject_GetItem (is that what it's called?)
I know numarray uses functions for this:
PyArrayObject* NA_InputArray( PyObject *numarray, NumarrayType t, int requires)
The purpose of NA_InputArray is to transfer array data from Pythonto C.
PyArrayObject* NA_OutputArray( PyObject *numarray, NumarrayType t, int requires)
The purpose of NA_OutputArray is to transfer data from C to Python. Practically speaking, the output numarray must be a PyArrayObject, and cannot be an arbitrary Python sequence.
PyArrayObject* NA_IoArray( PyObject *numarray, NumarrayType t, int requires)
NA_IoArray has fully bidirectional data transfer, creating the illusion of call-by-reference.
Simon.
More information about the Python-list
mailing list