[Numpy-discussion] casting integers to reals

Gideon Simpson simpson at math.toronto.edu
Thu Feb 26 17:53:28 EST 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