user1876508 user1876508 - 8 months ago 36
Python Question

Access individual cells in csv file with python

How can I access individual cells in a csv document to parse and edit them? Also is there a way I can convert the csv document into a two-dimensional array?


You are going to want to use the csv package that is made for python. You may want to try something like this (assuming your file is regularly structured and has no headers):

data = []
for row in csv.reader(open('you_file.csv', 'rb'), delimiter=',')

Give that a try and look through the csv package docs to learn more.