Row count in a csv file

with open(adresse,”r”) as f: reader = csv.reader(f,delimiter = “,”) data = list(reader) row_count = len(data) You are trying to read the file twice, when the file pointer has already reached the end of file after saving the data list.