On Thu, Feb 26, 2009 at 05:53:28PM -0500, Gideon Simpson wrote:
> 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?

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

but in this special case you can do:

numpy.arange(0., 10.)

Gaƫl
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to