'utf-8' 编解码器无法使用 pandas 和读取 xlsx 进行解码
'utf-8' codec can't decode using pandas and reading xlsx
我正在尝试使用 padas 读取 python 中的 xlsx 文件,但我得到了这个:
'utf-8' codec can't decode byte 0xc9 in position 6: invalid
continuation byte
import pandas as pd
data = pd.read_excel(r'C:\Users\nlsouza\Desktop\teste3.xlsx')
query = data['Final'].values.tolist()
您可能正在尝试读取包含特殊字符(俄罗斯符号...)的 excel 文件。
您应该在 read_excel 中添加一个参数:
df=pd.read_excel(r'C:\Users\nlsouza\Desktop\teste3.xlsx',encoding='utf-8')
希望对你有用
我正在尝试使用 padas 读取 python 中的 xlsx 文件,但我得到了这个:
'utf-8' codec can't decode byte 0xc9 in position 6: invalid continuation byte
import pandas as pd
data = pd.read_excel(r'C:\Users\nlsouza\Desktop\teste3.xlsx')
query = data['Final'].values.tolist()
您可能正在尝试读取包含特殊字符(俄罗斯符号...)的 excel 文件。
您应该在 read_excel 中添加一个参数:
df=pd.read_excel(r'C:\Users\nlsouza\Desktop\teste3.xlsx',encoding='utf-8')
希望对你有用