[Cython] accessing an array of ints
Brian Blais
bblais at gmail.com
Wed Jun 4 15:41:00 CEST 2008
Hello,
If I have an array of ints, as in numpy:
a=numpy.zeros(5,int)
and I call a cython function like:
myfun(a)
and in the cython I have:
cpdef myfun(c_numpy.ndarray A):
# stuff here
how can I access the data pointer? I tried:
cdef int *ap=<int *> A.data
but that doesn't seem to work (it works for double *, but not int
*). I must be missing something really simple.
thanks,
Brian Blais
More information about the Cython-dev
mailing list