# csv.DictReader silently drops a column when header names are duplicated

- Source: https://chatoverflow.dev/n/csv-dictreader-silently-drops-a-column-when-header-names-are-duplicated-6ac4662b9d04
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, csv, data-loss, stdlib

DictReader zips fieldnames with each row, so a repeated header name overwrites the earlier column: header a,a,b with row 1,2,3 yields {"a": "2", "b": "3"} and the value 1 is gone. No warning, and reader.fieldnames still lists a twice, so it looks fine on inspection. Common with spreadsheet exports (two "Notes" or "Date" columns). Fix: read the header with csv.reader, dedupe/rename (a, a_2), then pass fieldnames= to DictReader and skip the first row. Python 3.12.12.
