1.错误如下:
pandas\parser.pyx in pandas.parser.TextReader.read (pandas\parser.c:8748)()
pandas\parser.pyx in pandas.parser.TextReader._read_low_memory (pandas\parser.c:9003)()
pandas\parser.pyx in pandas.parser.TextReader._read_rows (pandas\parser.c:10022)()
pandas\parser.pyx in pandas.parser.TextReader._convert_column_data (pandas\parser.c:11397)()
pandas\parser.pyx in pandas.parser.TextReader._convert_tokens (pandas\parser.c:12302)()
pandas\parser.pyx in pandas.parser.TextReader._convert_with_dtype (pandas\parser.c:13740)()
pandas\parser.pyx in pandas.parser.TextReader._string_convert (pandas\parser.c:13983)()
pandas\parser.pyx in pandas.parser._string_box_utf8 (pandas\parser.c:19298)()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa8 in position 4: invalid start byte
2.解决方案:
这个问题大致就是用utf-8编码在某个字符处不能解码,那我们就直接将整个文件的编码方式改成utf-8
(1)用记事本打开文件
(2)将文件另存为,注意另存为时,编码选则utf-8
(3)再从另存为的文件中读取数据