[Numpy-discussion] casting integers to reals

Gideon Simpson simpson@math.toronto....
Thu Feb 26 16:53:28 CST 2009


I want to do:

numpy.float(numpy.arange(0, 10))

but get the error:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: only length-1 arrays can be converted to Python scalars

How should I do this?

-gideon



More information about the Numpy-discussion mailing list