我正在尝试读取s3存储桶中的csv文件,但出现错误。似乎有问题。list()
import csv
import s3fs
fs = s3fs.S3FileSystem(key='key', token='token', secret='secret')
def open_csv():
with fs.open('way/to/my.csv', 'rb') as csv_file:
csv_reader = list(csv.reader(csv_file))
return csv_reader
原木:
csv_reader = list(csv.reader(csv_file))
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
哈士奇WWW
相关分类