20 May
2006
20 May
'06
12:43 p.m.
a=numpy.array([1,2,3],numpy.Int8) a array([1, 2, 3], dtype=int8) a*2 array([2, 4, 6], dtype=int16)
My little 2 lives happily as an int8, so why is the int8 array cast to an int16 ? I spent quite a while finding this bug. Furthermore, this works:
a*a array([1, 4, 9], dtype=int8)
but not this:
a*numpy.array(2,dtype=numpy.Int8) array([2, 4, 6], dtype=int16)
print numpy.__version__ 0.9.9.2533
Simon. -- Simon Burton, B.Sc. Licensed PO Box 8066 ANU Canberra 2601 Australia Ph. 61 02 6249 6940 http://arrowtheory.com
6523
Age (days ago)
6523
Last active (days ago)
2 comments
2 participants
participants (2)
-
Simon Burton
-
Travis Oliphant