[Numpy-discussion] ValueError: invalid literal for float()

Charles R Harris charlesr.harris@gmail....
Fri Feb 27 09:35:42 CST 2009


On Fri, Feb 27, 2009 at 8:20 AM, Nils Wagner
<nwagner@iam.uni-stuttgart.de>wrote:

> Hi all,
>
> Is it possible to modify the behaviour of float wrt
> the following situation
>
>
> >>> permas_M[0,2]
> '1.5699999809265137D+01'
> >>> float(permas_M[0,2])
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ValueError: invalid literal for float():
> 1.5699999809265137D+01
>

I think float is python, not numpy,  but numpy uses the same function
internally to convert from a string.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20090227/5f00cc8e/attachment.html 


More information about the Numpy-discussion mailing list