What is the recommended way of allocating memory for a typed memory view?

Look here for an answer. The basic idea is that you want cpython.array.array and cpython.array.clone (not cython.array.*): from cpython.array cimport array, clone # This type is what you want and can be cast to things of # the “double[:]” syntax, so no problems there cdef array[double] armv, templatemv templatemv = array(‘d’) # This is fast … Read more