How to find specific row in Python CSV module

后端 未结 4 1532
慢半拍i
慢半拍i 2020-12-21 12:21

I need to find the third row from column 4 to the end of the a CSV file. How would I do that? I know I can find the values from the 4th column on with row[3] but how do

4条回答
  •  长情又很酷
    2020-12-21 13:14

    You could keep a counter for counting the number of rows:

    counter = 1
    for row in reader:
        if counter == 3:
            print('Interested in third row')
        counter += 1
    

提交回复
热议问题