python - Row count in a csv file -
i making stupid mistake, can't find is. want count number of lines in csv file. wrote this, , isn't working: have row_count = 0
while should 400. cheers.
f = open(adresse,"r") reader = csv.reader(f,delimiter = ",") data = [l l in reader] row_count = sum(1 row in reader) print row_count
with open(adresse,"r") f: reader = csv.reader(f,delimiter = ",") data = list(reader) row_count = len(data)
you trying read file twice, when file pointer has reached end of file after saving data
list.
Comments
Post a Comment