Count how many records are in a CSV Python?

后端 未结 16 1463
无人共我
无人共我 2020-11-29 16:43

I\'m using python (Django Framework) to read a CSV file. I pull just 2 lines out of this CSV as you can see. What I have been trying to do is store in a variable the total n

16条回答
  •  借酒劲吻你
    2020-11-29 17:26

    Use "list" to fit a more workably object.

    You can then count, skip, mutate till your heart's desire:

    list(fileObject) #list values
    
    len(list(fileObject)) # get length of file lines
    
    list(fileObject)[10:] # skip first 10 lines
    

提交回复
热议问题