What is confusing is that if you want to create an array that you use
chunk = np.array ( [[94.,3.],[44.,4.]], dtype=np.float64)
But if you want to determine the type inside the buffer reference, you use
cdef func1 (np.ndarray[np.float64_t, ndim=2] A): print A
Note the difference between np.float64 and np.float64_t .
My fortune-telling
I assume a type identifier is what is explicitly created by the w / Cython C-like typedef syntax
ctypedef np.float64_t dtype_t
But the numpy type is just a Python <type 'type'> .
>>> type ( np.float64) <type 'type'>
Numpy's dtype doesn't help me. http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html
Heywatchthis
source share