ValueError:float()的文字无效: [英] ValueError: invalid literal for float():

查看:83
本文介绍了ValueError:float()的文字无效:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究线性回归程序,当我尝试将输入文件数据转换为float(它以字符串形式读入)时,我收到此错误。也许有人可以帮助我?我正在使用Windows XP和IDLE。 (也是控制台屏幕)。

I''m working on a linear regression program and when I try to convert the input file data to a float (it reads in as a string), I get this error. Perhaps someone can help me? I''m using Windows XP, and IDLE. (also the console screen).

展开 | 选择 | Wrap | 行号

推荐答案


我正在研究线性回归程序,当我尝试将输入文件数据转换为float(它以字符串形式读入)时,我收到此错误。也许有人可以帮助我?我正在使用Windows XP和IDLE。 (也是控制台屏幕)。

I''m working on a linear regression program and when I try to convert the input file data to a float (it reads in as a string), I get this error. Perhaps someone can help me? I''m using Windows XP, and IDLE. (also the console screen).

展开 | 选择 | Wrap | 行号



我正在研究线性回归程序,当我尝试将输入文件数据转换为float(它以字符串形式读入)时,我收到此错误。也许有人可以帮助我?我正在使用Windows XP和IDLE。 (也是控制台屏幕)。

I''m working on a linear regression program and when I try to convert the input file data to a float (it reads in as a string), I get this error. Perhaps someone can help me? I''m using Windows XP, and IDLE. (also the console screen).

展开 | 选择 | Wrap | 行号


好的,我现在看到了。但是我不知道如何在我的for循环中使用它。或者我在for循环中使用它?在将文件数据附加到列表之前,难道不能将文件数据转换为浮动吗?
ok, I see now. But I''m not sure how to use that with my for loop. Or do I use it in the for loop? Shouldn''t I convert the file data to float before I append it to my list?


这篇关于ValueError:float()的文字无效:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆