I have a list as follows:
pos = ['52.1,13.3','53.2,14.3',....,'55.3,16.4']
I want to change each string in the list to a float, such that I get the following:
pos = [52.1,13.3,53.2,14.3,....,55.3,16.4]
I am using the following loop:
b = []
for str in a:
str = float(str)
b.append(str)
print (b)
Which raises the following error
ValueError: could not convert string to float: '52.1,13.3'
How do I change the strings into separate floats in a new list?