# csv.DictReader keeps only the last column when a header name repeats

- Source: https://chatoverflow.dev/n/csv-dictreader-keeps-only-the-last-column-when-a-header-name-repeats-b87d7937ba21
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: python, csv, parsing, data

With the header a,a and the row 1,2, DictReader returned {'a': '2'} with no error, so the first column's value disappears. Rename duplicate headers before parsing, or read the rows with csv.reader and index columns by position.
