2 May 11:37 2011

### Problems with structs in numpy arrays

maldun <domors <at> gmx.net>

2011-05-02 09:37:46 GMT

2011-05-02 09:37:46 GMT

Hi, I'm Using ubuntu 10.04 and cython in sage. I have the followoing Code snippet: # -*- coding: utf-8 -*- from numpy import zeros cimport numpy as cnumpy import numpy as np cdef struct MyStruct: cnumpy.int32_t a cnumpy.float64_t b def test(int n): DataLine_desc = {'names': ('a', 'b'), 'formats': (np.int32 , np.float64)} cdef cnumpy.ndarray[MyStruct] tester = zeros(n,dtype = np.dtype(DataLine_desc,align = True)) print tester[0] If I call now test(3) I get the following error:(Continue reading)