简体   繁体   English

为什么Pandas打开.xls文件扩展名比.xlsx快

[英]Why does Pandas open .xls file extension faster than .xlsx

When I open excel file with.xls format here it is opened faster than in case of.xlsx extension here using Pandas.当我在此处打开具有.xls 格式的 excel 文件时,它的打开速度比此处使用 Pandas 的 .xlsx 扩展名要快。 I am using Pandas 1.0.1 and Python 3.7.6.我正在使用 Pandas 1.0.1 和 Python 3.7.6。 These files are literally the same, I just renamed file names and first sheet name for the sake of convenience.这些文件实际上是相同的,为了方便起见,我只是重命名了文件名和第一个工作表名。 The files consist of 6 sheets with 49 columns and approximately 1700 rows numeric data in each sheet.这些文件由 6 张表格组成,每张表格中有 49 列和大约 1700 行数字数据。 As you can see I am just reading only the first sheet here, but the same result holds for any number of sheets and rows.如您所见,我只是在这里阅读第一张纸,但对于任何数量的纸和行,结果都是一样的。 (Almost 4x time difference) (几乎是 4 倍的时差)

Is this the reason?这是原因吗? [From https://windowsfileviewer.com] [来自 https://windowsfileviewer.com]

"While XLS files use a proprietary binary format, XLSX files use a newer file format referred to as Open XML. The XLS extension is used by Microsoft Excel 2003 and earlier and the XLSX extension is used by Microsoft Excel 2007 and later" "While XLS files use a proprietary binary format, XLSX files use a newer file format referred to as Open XML. The XLS extension is used by Microsoft Excel 2003 and earlier and the XLSX extension is used by Microsoft Excel 2007 and later"

I could not find any information on Panda`s official documentation.我在 Panda 的官方文档中找不到任何信息。 I am just wondering why and how this happens.我只是想知道为什么以及如何发生这种情况。

maybe because XLS files use a proprietary binary format whereas, XLSX use a newer file format known as Open XML可能是因为 XLS 文件使用专有的二进制格式,而 XLSX 使用更新的文件格式,称为 Open XML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM