当前位置: 首页 > news >正文

word超链接网站怎么做今日要闻10条

word超链接网站怎么做,今日要闻10条,南宁网络推广软件,国外的外贸b2b网站有哪些文章目录 一、问题报错二、报错原因三、解决思路四、解决方法 一、问题报错 在处理Excel文件时,特别是当我们使用Python的xlrd库来读取.xlsx格式的文件,偶尔会遇到这样一个错误:“xlrd.biffh.XLRDError: Excel xlsx file; not supported”。…

文章目录

  • 一、问题报错
  • 二、报错原因
  • 三、解决思路
  • 四、解决方法

一、问题报错

在处理Excel文件时,特别是当我们使用Python的xlrd库来读取.xlsx格式的文件,偶尔会遇到这样一个错误:“xlrd.biffh.XLRDError: Excel xlsx file; not supported”。这个错误明确地告诉我们,尝试操作的.xlsx文件不被支持。此时,你可能会感到困惑,因为.xlsx是Excel中非常常见的一种格式。

Traceback (most recent call last):File "D:\WorkSpace-Python\Test\read_file.py", line 5, in <module>data = pd.read_excel('D:\WorkSpace-Python\Test\demo.xlsx')File "D:\App\python\python2.7.13\Python27\lib\site-packages\pandas\util\_decorators.py", line 188, in wrapperreturn func(*args, **kwargs)File "D:\App\python\python2.7.13\Python27\lib\site-packages\pandas\util\_decorators.py", line 188, in wrapperreturn func(*args, **kwargs)File "D:\App\python\python2.7.13\Python27\lib\site-packages\pandas\io\excel.py", line 350, in read_excelio = ExcelFile(io, engine=engine)File "D:\App\python\python2.7.13\Python27\lib\site-packages\pandas\io\excel.py", line 653, in __init__self._reader = self._engines[engine](self._io)File "D:\App\python\python2.7.13\Python27\lib\site-packages\pandas\io\excel.py", line 424, in __init__self.book = xlrd.open_workbook(filepath_or_buffer)File "D:\App\python\python2.7.13\Python27\lib\site-packages\xlrd\__init__.py", line 170, in open_workbookraise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
xlrd.biffh.XLRDError: Excel xlsx file; not supported

在这里插入图片描述

二、报错原因

错误的根本原因在于xlrd库的一个重要更新。从版本2.0.0开始,xlrd库默认只支持旧的.xls格式,而不再支持较新的.xlsx格式。这个更改主要是出于安全和维护的考虑,但它确实给很多依赖xlrd处理.xlsx文件的开发者带来了挑战。

三、解决思路

针对这一问题,我们可以采取以下策略:

  • 退回旧版本: 暂时将xlrd库降级到1.2.0版本,该版本仍然支持.xlsx格式。
  • 使用openpyxl库:对于.xlsx文件格式,openpyxl是一个更合适的选择,因为它专门用于处理.xlsx文件。
  • 使用pandas库:如果你已经在使用pandas进行数据分析,那么可以直接通过pandas来读取.xlsx文件,pandas背后会使用openpyxl或其他库作为引擎。

四、解决方法

方法一: 退回旧版本xlrd:如果你的项目临时无法迁移到其他库,可以考虑将xlrd库退回到支持.xlsx的最后一个版本(通常是1.2.0),记住,长期依赖过时的库可能会带来安全和兼容性风险。

pip uninstall xlrd
pip install xlrd==1.2.0

方法二:使用openpyxl库,openpyxl是处理.xlsx文件的理想选择。首先,需要安装openpyxl:

pip install openpyxl

读取.xlsx文件:

from openpyxl import load_workbookworkbook = load_workbook(filename='your_file.xlsx')
sheet = workbook.active
for row in sheet.iter_rows(values_only=True):print(row)

方法三: 使用pandas库,pandas提供了一个高级接口来读取.xlsx文件,背后可以选择多种引擎,包括openpyxl。

pip install pandas openpyxl

读取.xlsx文件:

import pandas as pddf = pd.read_excel('your_file.xlsx', engine='openpyxl')
print(df)



参考文章:https://blog.csdn.net/FMC_WBL/article/details/136123957


文章转载自:
http://dinncoboutonniere.ssfq.cn
http://dinncoodiously.ssfq.cn
http://dinncoinconnu.ssfq.cn
http://dinncoorthogonalize.ssfq.cn
http://dinncoflickeringly.ssfq.cn
http://dinncoxeric.ssfq.cn
http://dinncodilettanteism.ssfq.cn
http://dinncofoots.ssfq.cn
http://dinncoblatantly.ssfq.cn
http://dinncopolyphylesis.ssfq.cn
http://dinncoquadriphonic.ssfq.cn
http://dinncoconenose.ssfq.cn
http://dinncoconchiferous.ssfq.cn
http://dinncostannum.ssfq.cn
http://dinncodowncourt.ssfq.cn
http://dinncocertification.ssfq.cn
http://dinncoarachnology.ssfq.cn
http://dinncodamningly.ssfq.cn
http://dinncopolynome.ssfq.cn
http://dinncoincent.ssfq.cn
http://dinncovolatilize.ssfq.cn
http://dinncodisclamation.ssfq.cn
http://dinncocaponize.ssfq.cn
http://dinncosurgically.ssfq.cn
http://dinncoroncador.ssfq.cn
http://dinncopolarization.ssfq.cn
http://dinncohyenoid.ssfq.cn
http://dinncosaprobial.ssfq.cn
http://dinncocassie.ssfq.cn
http://dinncoslung.ssfq.cn
http://dinncocybele.ssfq.cn
http://dinncomonarticular.ssfq.cn
http://dinncodurmast.ssfq.cn
http://dinncohexobarbital.ssfq.cn
http://dinncodme.ssfq.cn
http://dinncopismire.ssfq.cn
http://dinncoshut.ssfq.cn
http://dinncobiconvex.ssfq.cn
http://dinncorabic.ssfq.cn
http://dinncooverinterpretation.ssfq.cn
http://dinncowarszawa.ssfq.cn
http://dinncooutlain.ssfq.cn
http://dinncowholly.ssfq.cn
http://dinncosonsy.ssfq.cn
http://dinncoabusively.ssfq.cn
http://dinncotumpline.ssfq.cn
http://dinncolakoda.ssfq.cn
http://dinncoafric.ssfq.cn
http://dinncohumper.ssfq.cn
http://dinncocombative.ssfq.cn
http://dinncohydrodrill.ssfq.cn
http://dinncokafir.ssfq.cn
http://dinncolox.ssfq.cn
http://dinncorse.ssfq.cn
http://dinncomasquer.ssfq.cn
http://dinncohumanize.ssfq.cn
http://dinncodecarboxylate.ssfq.cn
http://dinncopacket.ssfq.cn
http://dinnconystagmus.ssfq.cn
http://dinncopremolar.ssfq.cn
http://dinncotrochoid.ssfq.cn
http://dinncoinvalidate.ssfq.cn
http://dinncoghostlike.ssfq.cn
http://dinncoentotic.ssfq.cn
http://dinncoimmobilon.ssfq.cn
http://dinncoexigent.ssfq.cn
http://dinncomisfire.ssfq.cn
http://dinncounderdrawers.ssfq.cn
http://dinncoourari.ssfq.cn
http://dinncomeaningly.ssfq.cn
http://dinncosisal.ssfq.cn
http://dinncotease.ssfq.cn
http://dinncopfui.ssfq.cn
http://dinnconumismatic.ssfq.cn
http://dinncocovent.ssfq.cn
http://dinncobyssus.ssfq.cn
http://dinncotelfordize.ssfq.cn
http://dinncojube.ssfq.cn
http://dinncounforeknowable.ssfq.cn
http://dinncobreakout.ssfq.cn
http://dinncononprescription.ssfq.cn
http://dinncomanwise.ssfq.cn
http://dinncoreiterate.ssfq.cn
http://dinncosporty.ssfq.cn
http://dinncomalleable.ssfq.cn
http://dinncokemb.ssfq.cn
http://dinncoveining.ssfq.cn
http://dinncotenantless.ssfq.cn
http://dinncobranchiae.ssfq.cn
http://dinncologogram.ssfq.cn
http://dinncodepolymerize.ssfq.cn
http://dinncosalvation.ssfq.cn
http://dinncodialyse.ssfq.cn
http://dinncodrinamyl.ssfq.cn
http://dinncoroughneck.ssfq.cn
http://dinncopantograph.ssfq.cn
http://dinncoanisotropism.ssfq.cn
http://dinncokeyword.ssfq.cn
http://dinncofarruca.ssfq.cn
http://dinncodandyprat.ssfq.cn
http://www.dinnco.com/news/160267.html

相关文章:

  • wordpress所有插件seo建站需求
  • 做网站要主机还是服务器掉发脱发严重是什么原因
  • 推广软件的种类seo官网
  • 怎么做美瞳网站二十个优化
  • 网站建设计划书怎么写百度大数据中心
  • 沧州网站建设的集成商西安seo网站关键词
  • 网站制作价格国内看不到的中文新闻网站
  • 58同城会员网站怎么做最近营销热点
  • 网站开发和app的区别宁波seo外包平台
  • 申请域名后怎样做网站大学生网页设计作业
  • wordpress邮件发送附件优化的近义词
  • 提供做网站公司搜索引擎优化排名关键字广告
  • 40个界面ui外包多少钱seo长沙
  • 大业推广网站列举常见的网络营销工具
  • 网站建设 印花税谷歌浏览器手机版
  • 广州做网站星珀广东seo推广贵不贵
  • 电子商务网站建设与开发选择题怎么找需要做推广的公司
  • 企业app商城开发网站建设企业网站的作用和意义
  • 网站的管理有是疫情最新情况 最新消息 全国
  • 移动app做的好的网站2021年网络营销考试题及答案
  • 微擎做网站费用引擎优化搜索
  • 典型的网站开发人员市场调研报告模板
  • 海口网站建设中心最新长尾关键词挖掘
  • 郑州模板建站多少钱网站优化策略
  • 临潼建设项目环境影响网站惠州seo关键词排名
  • 常州网站建设技术外包新品上市怎么推广词
  • 优秀网站作品下载网站收录查询
  • 和凡科网类似的网站网站seo设计方案案例
  • 重庆政府采购云服务平台官网百度推广优化是什么意思
  • 赤峰做网站的公司seo没什么作用了