解决 pandas 在读取 excel 文件报出警告的问题 UserWarning: Unknown extension is not supported and will be removed

Python 3.11.9
pandas 2.2.2
openpyxl 3.1.5

data_frame = pd.read_excel(
    input_file, "january_2013", index_col=None, engine="openpyxl"
)

出现如下警告:

D:\python311\Lib\site-packages\openpyxl\worksheet\_reader.py:329: UserWarning: Unknown extension is not supported and will be removed
  warn(msg)

我的解决方案是:xl 文件中有不能识别的数据类型,一般应该是 自定义,特别是在日期格式的时候,将其修改为短日期来解决这个问题

img

posted @ 2025-01-16 14:52  JPL-JUNO  阅读(364)  评论(0)    收藏  举报