I am trying to convert the following string into float: u'"0.5"' but it seems that it does not work. I am trying to use float(str1) and I am receiving the following error:
ValueError: could not convert string to float: "0.5"
It seems is the way that I have stored the string. But how can I convert it into a float properly?
float(str1.strip('"'))float(ast.literal_eval(u'"0.5"'))