WARNING *** file size (1080329) not 512 + multiple of sector size (512)
之前写过一篇【关于pd.read_excel()读取xls文件报错的解决办法】
原文链接:https://blog.csdn.net/qq_35866846/article/details/103992604
优化下读取函数,便于多个sheet读取,和pd.read_excel一样,sheet_name可以用序号也可以用sheet名
#自定义xls文件读取函数 默认header=0,sheet_name=0
def read_xls_xcx(data_path,header=0,sheet_name=0):data=xlrdxcx.open_workbook(data_path)if type(sheet_name)==int:table=data.sheet_by_index(sheet_name)#通过索引打开else:table=data.sheet_by_name(sheet_name) #通过表单名打开nrows = table.nrowsncols = table.ncolsresult=[]for i in range(header,nrows):result1=[]for j in range(ncols):result1.append(table.cell(i, j).value)result.append(result1)pd_result=pd.DataFrame(result)pd_result.columns=pd_result.iloc[0,].tolist()pd_result=pd_result[1:].reset_index(drop=True)return pd_result
今天要说的问题不是这个,这个只是附带优化下
重点问题是关于读取xls时的一个警告
WARNING *** file size (1080329) not 512 + multiple of sector size (512)
产生这个错误的原因是xlrd下的compdoc.py文件的第117-118行附近(看有的是119行)代码
print("WARNING *** file size (%d) not 512 + multiple of sector size (%d)"% (len(mem), sec_size), file=logfile)
经测试:
是因为下载的数据是受保护视图
,excel打开如下图提示,当启用编辑并保存
后,此处警告就不存在了
具体什么原因还不是太清楚,此警告不影响读取的数据内容
WARNING *** file size (1080329) not 512 + multiple of sector size (512)相关推荐
- Python音频转成numpy数组:numpy.frombuffer报错ValueError: buffer size must be a multiple of element size
使用背景:导入音频信号,下面代码段最后一句报错 import wave import numpy as npf = wave.open(wav_path) params = f.getparams() ...
- 计算机硬盘的扇区大小,了解硬盘扇区大小(Understanding Hard Disk Sector Size)
了解硬盘扇区大小(Understanding Hard Disk Sector Size) 我目前正在开发一个与原始磁盘操作交互的内核模式驱动程序. 我希望更多地了解行业规模的概念. 在制造HDD时, ...
- PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0
为什么80%的码农都做不了架构师?>>> 不同电脑,相同的代码怎么就上传不了图片:本人用的是PHP upload上传项目下的retime文件夹 服务器突然出现这种提示,无法上传 ...
- make: warning: file “xxx“ has modification time yyy s in the future 解决方法
一.引言 最近在工作中,在本地将代码文件上传到远端服务器,在远端服务器进行 make 编译的时候,会报这样的错: make: Warning: File "xxx" has mod ...
- make: Warning: File “xxx“ has modification time yyy s in the future
make: Warning: File "xxx" has modification time yyy s in the future 问题背景: 执行 gmake clean 打 ...
- 解决 make[1]: Warning: File ‘xxx.o‘ has modification time xxx s in the future 问题
问题描述 make[1]: Warning: File 'xxx.o' has modification time xxx s in the future make[1]: Warning: Cloc ...
- xampp Setting file ‘D:\E\develop_software\xampp\mysql\data\ibtmp1‘ size to 12 MB. Physically writing
安装xampp,启动mysql,出现以下报错 InnoDB: using atomic writes. 2022-06-23 9:18:29 0 [Note] InnoDB: Mutexes and ...
- 磁盘的块大小(Block Size)和扇区大小(Sector Size)
来源:http://chenjianjx.iteye.com/blog/1806258 Logical Block Size:A "block", a contiguous num ...
- PBlaze5 920系列特性——可变Sector Size管理(上)
这是一条nvmecli的format命令,需要指出的是这条命令会打开PBlaze5 系列NVMe SSD端到端数据保护功能.当下,端到端数据保护技术已经是PBlaze5 910/916及最新发布的PB ...
最新文章
- 敏捷为什么会失败之「PA-SA-WAKA-DA」理论
- 【PHP】 数组分页函数、根据字段排序并分页
- 用c语言写代码_如何避免用动态语言的思维写Go代码
- 认识 Express 的 res.send() 和 res.end()
- python 基础知识
- 基金定投需要注意波段操作!(文章有点长,含Python代码)
- MBTI各个字母的含义是什么
- C# 30分钟完成百度人脸识别——进阶篇(文末附源码)
- js删除数组指定的某个值或元素
- GICv3-4宏观视图
- c++日志工具之——log4cplus
- java word 加密_java 加密解密WORD文档
- vps与云服务器区别在哪里?
- 我的游戏学习日志52——游戏与艺术(3)
- 还有多少时间可以挥霍!
- 2023跨年代码(烟花+自定义文字+背景音乐+雪花+倒计时)
- ArcMap将png图像矢量化
- bridge 的运用和数码照片的处理
- 计算机网络:常见的计网面试题整理(一)
- 后台管理员的权限管理实现