0
요청 라이브러리를 사용하여 CSV 파일을 읽으려고하는데 문제가 있습니다.URL을 사용하여 CSV 파일을 읽는 Python
import requests
import csv
url = 'https://storage.googleapis.com/sentiment-analysis-dataset/training_data.csv'
r = requests.get(url)
text = r.iter_lines()
reader = csv.reader(text, delimiter=',')
나는 다음
for row in reader:
print(row)
을 시도했지만 나에게이 오류 준 :
Error: iterator should return strings, not bytes (did you open the file in text mode?)
가 어떻게이 문제를 해결해야합니다를?
효과가있었습니다. 정말 고맙습니다! –