I'm trying to fill some floaty values from a file into a tuple with the following python code:
with open(filename, 'r') as file:
i=0
lines = file.readlines()
for line in lines:
if (line != None) and (i != 0) and (i != 1): #ignore first 2 lines
splitted = line.split(";")
s = splitted[3].replace(",",".")
lp1.heating_list[i-2] = float(s)
i+=1
The values originate from a .csv-file, where lines look like this:
MFH;0:15;0,007687511;0,013816233;0,023092447;
The problem is I get:
lp1.heating_list[i-2] = float(s)
ValueError: could not convert string to float:
And I have no idea whats wrong. Please illumiate me.