'ValueError:无法将字符串转换为浮点数:'5,742.86'

问题描述 投票:0回答:1

enter image description here 我试图将网站中的数据抓取到字典中并将其加载到数据帧中,但我不断遇到此错误 ValueError: Could not Convert string to float: '5,742.86' enter image description here

我期望程序将数字从字符串转换为浮点数。

python numpy web-scraping dictionary-comprehension python-beautifultable
1个回答
0
投票

python中的浮点数不能包含“,”符号,只能包含“.”,所以我可以转换'2.1',但不能转换'2,1'

© www.soinside.com 2019 - 2024. All rights reserved.