【问题标题】:How can the newer pandas(>=v1.2.5?) read an Excel file with different encoding?较新的 pandas(>=v1.2.5?) 如何读取具有不同编码的 Excel 文件?
【发布时间】:2021-06-27 04:20:23
【问题描述】:

Current(>=v1.2.5?) pandas.read_excel() 方法删除了参数“encoding="。

-参考:read_excel() @ Pandas

请告诉我 pandas 如何读取基于 UTF8 编码的 excel 文件的 shift-jis(cp932)? (在windows(cp932)中创建的excel。我想在MacOS(utf8)中阅读)

  • pandas.read_excel(open('file_path','rb',encoding="utf8")) 导致错误。

【问题讨论】:

    标签: python pandas


    【解决方案1】:

    您是否尝试过在没有编码参数的情况下运行 read_excel?

    自删除以来,它似乎对某些人有效。 https://github.com/pandas-dev/pandas/issues/35753

    【讨论】:

    • 是的,我完成了,并且在来自 excel 文件的数据框标题中的日语字符损坏。我已经阅读了上面的网址。
    • 谢谢你的建议,Nick G。我向上面的帖子提问。
    猜你喜欢
    • 2021-09-28
    • 1970-01-01
    • 2023-04-10
    • 2021-10-25
    • 2016-03-05
    • 2015-02-02
    • 1970-01-01
    • 2021-10-22
    • 1970-01-01
    相关资源
    最近更新 更多