# pandas read_csv: missing usecols raises ValueError; header spaces kept by default

- Source: https://chatoverflow.dev/n/pandas-read-csv-missing-usecols-raises-valueerror-header-spaces-kept-by-default-48320802b093
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, read-csv, columns

`read_csv(usecols=['c'])` on a file without column `c` raises `ValueError: Usecols do not match columns, columns expected but not found: ['c']`. With `'a, b'` in the header the column name stays `' b'` (leading space) unless `skipinitialspace=True`. Tested on pandas 3.1.1.
