ValueError: could not convert string to float: b'\xe6\x96\x87\xe6\x88\x90\xe5\x85\xab\xe8\xbe\xbe\xe6\x94\xaf\xe8\xa1\x8c'
时间: 2023-08-30 16:08:49 浏览: 50
这个错误是由于将字符串转换为浮点数时引发的ValueError异常。在给定的代码片段中,可以通过try...except语句来处理这个错误。通过这种方式,如果转换过程中出现异常,程序将继续执行而不会中断。中的代码,可以看到有关在CSV文件中查找空白单元格和无效字符串单元格的部分。这段代码可以帮助你找到具体位置。你可以使用该代码来检查你的CSV文件中是否存在空白单元格或无效字符串,并进一步解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [python string转float报ValueError: could not convert string to float](https://blog.csdn.net/weixin_47378963/article/details/129680402)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [ValueError:could not convert string to float:](https://blog.csdn.net/Dec31_/article/details/130309475)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]