how to get the memory address of a numpy array for C

后端 未结 2 756
慢半拍i
慢半拍i 2020-12-15 04:53

I constructed an numpy array::

a=np.ndarray([2,3]) 

then i want to see where its data are::

a.data 
>>>Out[213]: &         


        
2条回答
  •  渐次进展
    2020-12-15 05:18

    a.data might be a property whose getter function creates a new buffer object (meta data) on each call.

    To get the address see how numpy.ctypeslib.as_ctypes() is implemented.

提交回复
热议问题