[Numpy-discussion] Multidimension array access in C via Python API

mpc matt.p.conte at gmail.com
Mon Apr 4 13:35:45 EDT 2016


Hello, 

is there a C-API function for numpy that can implement Python's 
multidimensional indexing? 

For example, if I had a 2d array:

   PyArrayObject * M; 

and an index 

   int i; 

how do I extract the i-th row M[i,:] or i-th column M[:,i]?

Ideally it would be great if it returned another PyArrayObject* object (not
a newly allocated one, but whose data will point to the correct memory
locations of M).

I've searched everywhere in the API documentation, Google, and SO, but no
luck.

Any help is greatly appreciated.

Thank you.

-Matthew



--
View this message in context: http://numpy-discussion.10968.n7.nabble.com/Multidimension-array-access-in-C-via-Python-API-tp42710.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.



More information about the NumPy-Discussion mailing list