import numpy as np
a = np.array([1,3,12,0.43,234,-3,-4])
b = a[[1,3,5]]
print(b)
# array([ 3. , 0.43, -3. ])
Different from an int as the index of a numpy array, this example treats an array as an index.
I am confused that getting the designated indexes of a given numpy array, what is the corresponding C-API name?
the NUMPY C-API files is in numpy c-api
Thanks very much.
PyArray_Choose
.PyObject *PyArray_Choose(PyArrayObject *self, PyObject *op, PyArrayObject *ret, NPY_CLIPMODE clipmode)