A header is the first line of a CSV file. It lists field names such as exercise and reps, allowing later values to become named dictionary fields instead of anonymous positions. section 19.1.2
A simple parser reads the header, removes its newline, splits it on commas, and pairs the resulting names with each data row using zip(). Converting those pairs to a dictionary produces records such as {'exercise': 'Burpees', 'reps': '20-50'}. section 19.1.2
Reading headers in Python
with open('inputs/exercises.csv') as fh:\n headers = fh.readline().rstrip().split(',')\n records = [dict(zip(headers, line.rstrip().split(','))) for line in fh]
$ head -3 inputs/exercises.csv exercise,reps Burpees,20-50 Situps,40-100
Inspect the first three lines of a CSV to see the header preceding its data records. section 19.1.2


