Skip header in Python CSV reader
This tutorial is Skip header in Python CSV reader
. The CSV module implements classes to read and write tabular data in CSV format. CSV (Comma Separated Values) is the most common import and export format for spreadsheets and databases. you can also read and write data in dictionary form using the DictReader and DictWriter classes.
I wanted to use Python built-in CSV reader class and skip the header line.
devnote.csv
first_name,last_name,age Patsy,Summerscales,20 Ebeneser,Point,16 Alard,Labbe,18 Ulrika,Nusche,26
Example
import csv with open('devnote.csv') as file: csv_reader_object = csv.reader(file) next(csv_reader_object) for value in csv_reader_object: # just use positional indexing print (value[0]) #first_name print (value[1]) #last_name print (value[2]) #age