[Python] What is the corresponding C-api name of the following numpy function in Python

Discussão em 'Python' iniciado por Stack, Junho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to write a C extension lib for Python, aiming to replace Python code with C.

    The Python codes has several lines like below:

    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

    Continue reading...

Compartilhe esta Página