小编Mic*_*ang的帖子

如何在 Cython 中定义列表

我想将以下python代码转换为Cython

x_array = []

x_array.append(x_new)
Run Code Online (Sandbox Code Playgroud)

我尝试了以下 Cython 代码,但它给出了错误:

cdef np.ndarray[double, dim=1] x_array

x_array.append(x_new)
Run Code Online (Sandbox Code Playgroud)

错误显示:

Cannot coerce list to type [double, dim=1]

arrays list cython python-3.x

10
推荐指数
1
解决办法
1万
查看次数

标签 统计

arrays ×1

cython ×1

list ×1

python-3.x ×1