[Tutor] ValueError: could not convert string to float: '13,2'

Pierre Dagenais pierre.dagenais at ncf.ca
Tue Dec 31 14:53:38 CET 2013


Hi,

I'm trying to convert a list of strings to float. Unfortunately the
numbers are written with a decimal comma instead of a decimal point.
What is the best way to replace these commas with decimal points? Do I
need to write a function that will iterate over every alphanumeric,
replace the comma with a point and then rewrite the list, or is there a
better way?

Thank you,

PierreD.


More information about the Tutor mailing list