【问题标题】:Unable to read an Excel file using Pandas无法使用 Pandas 读取 Excel 文件
【发布时间】:2023-02-10 05:21:46
【问题描述】:

我可以像往常一样从 pandas 读取 Excel 文件:

df = pd.read_excel(join("./data", file_name) , sheet_name="Sheet1")

我收到以下错误:

ValueError:值必须是数字或包含 通配符

我做错了什么?

我正在使用:Pandas 1.5.3 + python 3.11.0 + xlrd 2.0.1

【问题讨论】:

  • 也许你的意思是 os.path.join("./data", file_name)?

标签: pandas openpyxl xlrd python-3.11


【解决方案1】:

我遇到了同样的问题,然后意识到我正在阅读的表格处于“过滤”模式。一旦我取消选择“排序和筛选”,read_excel 函数就会起作用。

【讨论】:

    猜你喜欢
    • 2023-04-10
    • 2022-01-19
    • 2019-03-18
    • 2018-01-25
    • 1970-01-01
    • 2016-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多