[Numpy-discussion] numpyx.pyx (recent svn) works?

Neal Becker ndbecker2@gmail....
Thu Feb 28 07:35:55 CST 2008


I tried numpyx.pyx with cython-0.9.6.12.  Here's what I got:
In [2]: import numpyx

In [3]: numpyx.test()
-=-=-=-=-=-=-=-=-=-=
printing array info for ndarray at 0x0
print number of dimensions: 0
address of strides: 0x0
strides:
memory dump:
   -1e-30
-=-=-=-=-=-=-=-=-=-=

-=-=-=-=-=-=-=-=-=-=
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/nbecker/cython/<ipython console> in <module>()

/home/nbecker/cython/numpyx.pyx in numpyx.test()
     94 
     95     for arr in [arr1,arr2,arr3,arr4,arr5]:
---> 96         print arr
     97         print_array_info(arr)
     98 

/home/nbecker/cython/numpyx.pyx in numpyx.print_array_info()
     12 
     13     print '-='*10
---> 14     print 'printing array info for ndarray at 0x%0lx'%(<c_python.Py_intptr_t>arr,)
     15     print 'print number of dimensions:',arr.nd
     16     print 'address of strides: 0x%0lx'%(<c_python.Py_intptr_t>arr.strides,)

TypeError: only length-1 arrays can be converted to Python scalars




More information about the Numpy-discussion mailing list