I am probably making a stupid mistake, but I can't find where it is. I want to count the number of lines in my csv file. I wrote this, and obviously isn't working: I have row_count = 0 while it should be 400. Cheers.
f = open(adresse,"r")
reader = csv.reader(f,delimiter = ",")
data = [l for l in reader]
row_count = sum(1 for row in reader)
print row_count
datalist. The reader object provides a one-time for-loop, once you've worked through it, it's gone. That's why the row_count is being read as 0: there's nothing left in the reader at that point. - Erdős-Bacon