Skip to content

Instantly share code, notes, and snippets.

@dettmering
Created September 22, 2012 18:43
Show Gist options
  • Save dettmering/3767366 to your computer and use it in GitHub Desktop.
Save dettmering/3767366 to your computer and use it in GitHub Desktop.
Python: Read CSV file into array
def readcsv(filename):
ifile = open(filename, "rU")
reader = csv.reader(ifile, delimiter=";")
rownum = 0
a = []
for row in reader:
a.append (row)
rownum += 1
ifile.close()
return a
@thejose5
Copy link

This reads each row as a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment