Re: [Tutor] converting strings to float: strange case

2014-04-28 Thread C Smith
.split() will split things based on whitespace or newlines. Do you know that your file is only going to contain things that should convert to floats? If you post your entire code, the error you have included will be more helpful as it points to a certain line. The last line in your code has (stri)

Re: [Tutor] converting strings to float: strange case

2014-04-28 Thread Joel Goldstick
On Apr 28, 2014 11:14 AM, "Gabriele Brambilla" < gb.gabrielebrambi...@gmail.com> wrote: > > Hi, > > I'm trying to convert a string to a float. It seems a basic thing but I don't know why I'm getting this erroris > > Traceback (most recent call last): > File "phresREADER.py", line 27, in > tr

Re: [Tutor] converting strings to float: strange case

2014-04-28 Thread Gabriele Brambilla
solved, sorry for the disturb http://stackoverflow.com/questions/23344345/strings-not-converting-to-float-as-expected/23344830#23344830 bye Gabriele 2014-04-28 11:13 GMT-04:00 Gabriele Brambilla < gb.gabrielebrambi...@gmail.com>: > Hi, > > I'm trying to convert a string to a float. It seems a

[Tutor] converting strings to float: strange case

2014-04-28 Thread Gabriele Brambilla
Hi, I'm trying to convert a string to a float. It seems a basic thing but I don't know why I'm getting this erroris Traceback (most recent call last): File "phresREADER.py", line 27, in tra = float(stri) ValueError: could not convert string to float: My file has this line 5.5e+000 5.