该错误是由于在尝试将字符串转换为浮点数时出错,因为该字符串为空或格式不正确。要解决此问题,您可以检查数据集中是否存在空值或格式不正确的值,并将其删除或替换为有效值。您还可以尝试使用其他数据加载方法,例如Pandas的read_csv()函数,它可以自动处理缺失值和格式错误的值。

ValueError could not convert string to float The above exception was the direct cause of the following exceptionTraceback most recent call last File main_modulepy line 18 in module X=nploadtxtpara

原文地址: https://www.cveoy.top/t/topic/bMdj 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录