0
Я использую Python (3.4) в Jupyter Notebook, который по умолчанию должен использовать utf-8 уже. Но при чтении некоторых данных из файла csv я получил следующую ошибку. Любая идея, как это исправить? Благодаря!UnicodeDecodeError в python-3.4
код считывается из файла CSV:
with open('my_data.csv') as csvfile:
line = csv.reader(csvfile)
for row in line:
print (row)
Ошибка:
Last executed 2017-01-06 04:58:59 in 85ms
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-19-09c617346fbb> in <module>()
14 line = csv.reader(csvfile)
15
---> 16 for row in line:
17 print (row)
/usr/lib/python3.4/encodings/ascii.py in decode(self, input, final)
24 class IncrementalDecoder(codecs.IncrementalDecoder):
25 def decode(self, input, final=False):
---> 26 return codecs.ascii_decode(input, self.errors)[0]
27
28 class StreamWriter(Codec,codecs.StreamWriter):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 2588: ordinal not in range(128)