我正在尝试将字符串转换为浮点数
具有浮点功能:
pointsx = float(x)
得到错误:ValueError:无法将字符串转换为浮点型:'0,3638412'
关于如何解决此问题的任何想法?
enter image description here
这应该起作用:
pointsx = float(x.replace( ',', '.'))
浮点数使用点.作为分隔符,而不是逗号。
.