[Numpy-discussion] Unwanted upcast from uint64 to float64

Torgil Svensson torgil.svensson at gmail.com
Thu Aug 31 01:15:36 CDT 2006

I'm using windows datetimes (100nano-seconds since 0001,1,1) as time
in a numpy array and was hit by this behaviour.

>>> numpy.__version__
>>> a=numpy.array([632925394330000000L],numpy.uint64)
>>> t=a[0]
>>> t
>>> type(t)
<type 'numpy.uint64'>
>>> t+1
>>> type(t+1)
<type 'numpy.float64'>
>>> t==(t+1)

I was trying to set t larger than any time in an array. Is there any
reason for the scalar to upcast in this case?


More information about the Numpy-discussion mailing list