更新时间:2022-10-15 08:49:02
您有一个 Excel 格式文件 (.xlsx) 并且您正试图将其读取为 csv (read_csv).它们是 2 种不同的格式……这是行不通的.
将您的 Excel 文件另存为 .csv 或使用读取 Excel 的库/方法.
The following code gives me a
import pandas as pd
path = 'C:\\Users\\vlac284\\Desktop\\Lighting\\sample_Myer\\sample_2.xlsx
df = pd.read_csv(path)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdb in position 1: invalid continuation byte
Similar postings did not help.
You have an Excel format file (.xlsx) and you are trying to read it as csv (read_csv). They are 2 different formats... that will not work.
Either save your Excel file as .csv or use a library / method that reads Excel.
(unicode错误)'unicodeescape'编解码器无法解码位置2-3中的字节:truncated \UXXXXXXXX escape
错误 UnicodeDecodeError: 'utf-8' 编解码器无法解码位置 0 中的字节 0xff:起始字节无效
导入numpy引发错误:SyntaxError:(unicode错误)'unicodeescape'编解码器无法解码位置2-3中的字节:截断的\ uXXXX转义
机器人框架 - UnicodeDecodeError:'ascii' 编解码器无法解码位置 49 中的字节 0xe9:输入文本时序号不在范围内(128)
转换为Jython的Python 3.5项目-UnicodeDecodeError:'unicodeescape'编解码器无法解码位置4-10的字节:非法Unicode字符