更新时间:2023-01-14 12:02:02
在启动numpy数组以匹配计算机上的C int
时,也可以使用dtype=np.dtype("i")
.
You can also use dtype=np.dtype("i")
when initiating a numpy array to match the C int
on your machine.
cdef int [:] y_c
c_array = np.ascontiguousarray(y, dtype=np.dtype("i"))