From: Neilen M. <nm...@su...> - 2006-11-14 14:45:43
|
Hi, I'm not sure if the following is expected to work on a 64bit machine: In [381]: import numpy as N In [382]: l = range(3) In [383]: i32 = N.array([0,2], N.int32) In [384]: i64 = N.array([0,2], N.int64) In [385]: l[i32[0]] --------------------------------------------------------------------------- exceptions.TypeError Traceback (most recent call last) /home/brick/akademie/NewCode/working/<ipython console> TypeError: list indices must be integers In [386]: l[i64[0]] Out[386]: 0 I'd expect the 32-bit indices to work since they can be upcast to 64bit without loss. Am I silly for thinking this way, or is it something numpy can/should address? This came up while working with sparse matrices: http://projects.scipy.org/scipy/scipy/ticket/307 Regards Neilen -- you know its kind of tragic we live in the new world but we've lost the magic -- Battery 9 (www.battery9.co.za) |