Im trying to initiate a fixed sized array within a cython class so multiple methods can use it. How can that be done?
cdef class My Class:
cdef public np.ndarray[np.float, ndim=1] myarr
def __cinit__(self,int history_length):
self.myarr = np.empty(history_length, dtype=np.float)
I am getting an error saying:
buffer types only allowed as function local variables
Is there a way to declare this and access this?
Thanks