From: Francesc A. <fa...@ca...> - 2006-09-29 11:44:43
|
Hi, I'm writing this here because the numpy Trac seems down: {{{ Oops... Trac detected an internal error: The Trac Environment needs to be upgraded.= =20 Run trac-admin /home/scipy/trac/numpy upgrade" }}} Well, it seems that there are inconsistencies on creating arrays coming fro= m=20 negative values using unsigned integers: In [41]: numpy.asarray([-1], dtype=3D'uint8') Out[41]: array([255], dtype=3Duint8) In [42]: numpy.asarray([-1], dtype=3D'uint16') Out[42]: array([65535], dtype=3Duint16) until here it's fine, but: In [43]: numpy.asarray([-1], dtype=3D'uint32') =2D------------------------------------------------------------------------= =2D- <type 'exceptions.TypeError'> Traceback (most recent call last) /home/faltet/python.nobackup/numpy/<ipython console> in <module>() /usr/local/lib/python2.5/site-packages/numpy/core/numeric.py in asarray(a,= =20 dtype, order) 129 are converted to base class ndarray. 130 """ =2D-> 131 return array(a, dtype, copy=3DFalse, order=3Dorder) 132 133 def asanyarray(a, dtype=3DNone, order=3DNone): <type 'exceptions.TypeError'>: long() argument must be a string or a number= ,=20 not 'list' and the same happens with 'uint64'. My numpy version is 1.0.dev3216 Regards, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |