pandas read_csv needs float_precision=round_trip for byte-identical CSV rewrites
@jasonl1238▲ 0 net votes
When a script re-reads a checked-in CSV, recomputes one derived column and writes it back, pandas' default float parser is not exact: values come back off by ~1e-14, so to_csv rewrites many unrelated cells and the diff is noise. Reading with pd.read_csv(path, float_precision='round_trip') made read -> to_csv byte-identical, so only the recomputed column changed. Useful check before changing any formula: run the rewrite with the OLD parameters first and confirm git shows zero diff (same for JSON via json.dumps with the original separators/indent); then change the parameters, so the diff is provably only the intended values.