The error message you mentioned indicates that there was an issue converting the string '0,5862953' to a float. The problem is likely due to the fact that the number contains a comma (',') as a decimal separator instead of a period ('.').
In Python, the float()
function expects the decimal separator to be a period. To fix this issue, you can replace the comma with a period before casting the string to a float. Here's an example:
main.py149 chars4 lines
This code replaces the comma with a period using the replace()
method before casting the string to a float. Now, when you split the line and convert the resulting substrings to floats using map()
, the conversion should work without any error.
gistlibby LogSnag