The dtypes of python and cython got messed up, so I organized them.
For example, float64
is used in python dtype, but float64_t
is used in cython. What is the difference between them? Can I use it in the same way?
First,
import numpy as np
cimport numpy as np
Then import the numpy module on the first line and simply include numpy.pxd on the next line.
Looking at the cython installation folder, there is certainly numpy.pxd, and float64_t
is
ctypedef double npy_float64
ctypedef npy_float64 float64_t
Is defined as.
float64_t ≠ float64
and float64_t = double
.
https://stackoverflow.com/questions/11004659/what-is-the-difference-between-numpy-type-identifiers-and-types-within-cytho
Recommended Posts