我构建了一个numpy数组::
a=np.ndarray([2,3])
Run Code Online (Sandbox Code Playgroud)
然后我想看看它的数据在哪里::
a.data
>>>Out[213]: <read-write buffer for 0x0482C1D0, size 48, offset 0 at 0x049E87A0>
a.data
>>>Out[214]: <read-write buffer for 0x0482C1D0, size 48, offset 0 at 0x049E82A0>
a.data
>>>Out[215]: <read-write buffer for 0x0482C1D0, size 48, offset 0 at 0x049E81C0>
Run Code Online (Sandbox Code Playgroud)
...
为什么每次偏移地址都不同?如果我想使用c_types将数据传输到ac函数::
ctypes_array = (ctypes.c_char * a.size * 8).from_address(ptr)
Run Code Online (Sandbox Code Playgroud)
我该如何获得ptr的价值?