How to read one single line of csv data in Python?

后端 未结 7 1357
终归单人心
终归单人心 2020-11-28 05:04

There is a lot of examples of reading csv data using python, like this one:

import csv
with open(\'some.csv\', newline=\'\') as f:
  reader = csv.reader(f)
          


        
7条回答
  •  萌比男神i
    2020-11-28 05:45

    The simple way to get any row in csv file

    import csv
    csvfile = open('some.csv','rb')
    csvFileArray = []
    for row in csv.reader(csvfile, delimiter = '.'):
        csvFileArray.append(row)
    print(csvFileArray[0])
    

提交回复
热议问题