I have a robot framework regression test which essentially queries (SQL) two tables which are supposed to have identical data, exports to JSON, and send the JSON to Python.
In Python, I'm trying to convert them to CSV.
This is my function to convert the JSON files to CSV:
data = pd.read_json(in_file)
data.to_csv(out_file, index=False, header=False)
Here's the problem, both tables and the JSON have a value stored in a double precision field as:
0.0008492000051774085
Right after the above to_csv() code is executed, this value gets converted and appears in the CSV as:
0.000849200005177
The last 4 digits are gone!
Why is this happening and what can I do to fix it?
Thanks!!