【发布时间】:2012-12-21 02:36:10
【问题描述】:
我在 python 中有一个 numpy.ndarrays(不同长度)的列表,需要非常快速地访问 python 中的那些。我认为指针数组可以解决问题。我试过了:
float_type_t* list_of_arrays[no_of_arrays]
for data_array in python_list_of_arrays:
list_of_arrays[0] = data_array
但是 cython 抱怨:
no_of_arrays < Not allowed in a constant expression
我尝试了几种方法来构造这个变量:
cdef extern from *:
ctypedef int const_int "const int"
(有更多创造性的尝试)-但不幸的是它不起作用。
请帮忙。
【问题讨论】: