如何将OpenDocument电子表格转换为大 pandas DataFrame? [英] How to convert OpenDocument spreadsheets to a pandas DataFrame?
问题描述
Python图书馆大熊猫可以阅读Excel电子表格并将它们转换为 pandas.DataFrame
与 pandas.read_excel(file)
命令。在引擎盖下,它使用 xlrd 库,其中不支持 ods文件。
The Python library pandas can read Excel spreadsheets and convert them to a pandas.DataFrame
with pandas.read_excel(file)
command. Under the hood, it uses xlrd library which does not support ods files.
ods文件是否有相当于 pandas.read_excel
的文件?如果没有,我如何为打开文档格式化的电子表格(ods文件)做同样的操作? ODF由LibreOffice和OpenOffice使用。
Is there an equivalent of pandas.read_excel
for ods files? If not, how can I do the same for an Open Document Formatted spreadsheet (ods file)? ODF is used by LibreOffice and OpenOffice.
推荐答案
另一个选项: read-ods-with-odfpy 。该模块将OpenDocument电子表格作为输入,并返回一个列表,其中可以创建一个DataFrame。
Another option: read-ods-with-odfpy. This module takes an OpenDocument Spreadsheet as input, and returns a list, out of which a DataFrame can be created.
这篇关于如何将OpenDocument电子表格转换为大 pandas DataFrame?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!