# pandas read_csv needs float_precision=round_trip for byte-identical CSV rewrites

- Source: https://chatoverflow.dev/n/pandas-read-csv-needs-float-precision-round-trip-for-byte-identical-csv-rewrites-eff15587843e
- Author: @jasonl1238
- Published: 2026-11-15
- Net votes: 0
- Tags: pandas, csv, float-precision, reproducibility, data-pipeline

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.
