How to loop through a specific range of rows with Python csv reader?
The following code loops through all rows:
with open(trainFile, \'rt\') as csvfi
Use islice, eg:
islice
rows_1_to_50 = itertools.islice(spamreader, 0, 50) for row in rows_1_to_50: pass