user1876508 user1876508 - 6 months ago 13
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?

Answer

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=',')
    data.append(row)

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