i am trying to create a cython class which creates a NumPy with zeros. Later i want to write float values in that Numpy... My python class looks like this:
class test:
def __init__(self, b):
self.b = b
self.eTest = np.zeros((100, 100))
My cython class looks like this so far:
import numpy as np
cimport numpy as np
FTYPE = np.float
ctypedef np.float_t FTYPE_t
cdef class test:
def __init__(self, b):
cdef np.ndarray[FTYPE_t, ndim=2, mode='c'] eTest <<<works fine without this line
self.eTest = np.zeros((100,100), dtype=FTYPE)
My cython code doesn't work so far. I am struggling with the question how to create a NumPy of zeros (100, 100) without any Python. Is that even possible? I am not really familiar in cython, i am sorry if i am asking some really trivial questions!
Many thanks for all your help and advices!