ho costruito una matrice NumPy ::come ottenere l'indirizzo di memoria di un array di NumPy per C
a=np.ndarray([2,3])
poi voglio vedere dove i dati sono ::
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>
...
perché ogni volta che l'indirizzo di offset è diverso? se voglio trasferire i dati a una funzione c utilizzando c_types da ::
ctypes_array = (ctypes.c_char * a.size * 8).from_address(ptr)
come dovrei ottenere il valore di ptr?
correlato http://stackoverflow.com/a/3671889/ – jfs