[Numpy-discussion] ValueError: cannot convert float to NaN to integer

Keith Goodman kwgoodman at gmail.com
Wed Jul 22 14:35:23 EDT 2009


On Ubuntu 9.04, python 2.6.2, numpy 1.2.1 this gives a ValueError:

x = np.array([1,2,3])
x[0] = np.nan
ValueError: cannot convert float to NaN to integer

But on Debian squeeze, python 2.5.4, numpy 1.2.1 the assignment works
(well, the float nan is convert to the int 0):

x[0] = np.nan
x
   array([0,1,2])

The numpy version numbers are the same. Is this a python issue?

BTW, is there a way to determine the svn revision number of numpy when
installed from binary?



More information about the NumPy-Discussion mailing list