I'm reading in a list of coordinates from a kml file giving me this output:
['-73.9972973,40.7075148', ..., '-73.9850235,40.7900946']
(Imagine the ... as a lot more coordinates similar to the first and last) I'm using the following code to try to accomplish this but it won't work.
manhattanCoords = []
for coord in coords:
pair = [float(s) for s in coord.strip().split(", ")]
manhattanCoords.append(pair)
I get the following error:
Traceback (most recent call last):
File "Manhattan_Coords_Extract.py", line 12, in <module>
pair = [float(s) for s in coord.strip().split(", ")]
File "Manhattan_Coords_Extract.py", line 12, in <listcomp>
pair = [float(s) for s in coord.strip().split(", ")]
ValueError: could not convert string to float: '-73.9972973,40.7075148'
Does anyone have any suggestions?