Articles → Python → Read CSV File In Python

Read CSV File In Python






CSV File




Picture showing the sample CSV file



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


Picture showing output of reading the csv file using python



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

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250