python csv reader, loop from the second row -
in python 2.7.3, how can start loop second row? e.g.
first_row = cvsreader.next(); row in ???: #expect begin loop second row blah...blah...
first_row = next(csvreader) # compatible python 3.x (also 2.7) row in csvreader: # begins second row # ...
testing works:
>>> import csv >>> csvreader = csv.reader(['first,second', '2,a', '3,b']) >>> header = next(csvreader) >>> line in csvreader: print line ['2', 'a'] ['3', 'b']
Comments
Post a Comment