You are seeing this because there is an error in your logic and/or code for pulling the floats out of the lines from your file. This is resulting in a call to float()
that looks something like this:
>>> float('222.30777, 8.9363889')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for float(): 222.30777, 8.9363889
Currently you are trying to split each line on the string 'delimiter'
, so for example 'FOOdelimiterBAR'.split('delimiter')
would result in ['FOO', 'BAR']
.
From looking at the error message it looks like the floats are separated by a comma, so if you have a variable named delimiter
then you should use line.strip().split(delimiter)
, or just use line.strip().split(',')
if you know you want to be splitting on comma.