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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -