Articles → Python → Read CSV file in python

Read CSV file in python






CSV file





Click to Enlarge


Code


import csv

with open(r"c:\temp\Book1.csv", 'rt') as f:
  data = csv.reader(f)
  #skipping header
  next(data)
  
  for row in data:
        print(row[0])



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, May 30, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250