Row count in a csv file

后端 未结 5 1577
情深已故
情深已故 2020-12-01 20:31

I am probably making a stupid mistake, but I can\'t find where it is. I want to count the number of lines in my csv file. I wrote this, and obviously isn\'t working: I have

5条回答
  •  情话喂你
    2020-12-01 21:25

    If you are working with python3 and have pandas library installed you can go with

    import pandas as pd
    
    results = pd.read_csv('f.csv')
    
    print(len(results))
    

提交回复
热议问题