Assuming that the Python object contains floating point values stored to double precision, then your code works as you expect.
Most likely you are simply mis-diagnosing a problem that does not exist. My guess is that you are looking at the values in the debugger which only displays the values to a limited precision. Or you are printing them out to a limited precision.