For the floating point numbers, you can just cast the string to a float
:
>>> float('123.4506780')
123.450678
For the zero values, you can just cast those to an integer:
>>> int('0000')
0
When printed, numeric values are automatically converted to strings. If you need these to actually be strings, you may simply cast them back to strings with str()
, e.g.:
>>> str(float('123.4506780'))
'123.450678'