I'm trying to convert to floats
the string
values (which should have been represented as float originally) in the following dict:
{'a': '1.3', 'b': '4'}
If I try a dict comprehension:
{k:float(v) for v in d.values()}
I end up with just the second item in the dict:
In [191]: {k:float(v) for v in d.values()}
Out[191]: {'b': 4.0}
Why is this?