How to convert OpenDocument spreadsheets to a pandas DataFrame?

前端 未结 11 1652
日久生厌
日久生厌 2020-12-23 19:40

The Python library pandas can read Excel spreadsheets and convert them to a pandas.DataFrame with pandas.read_excel(file) command. Under the hood,

11条回答
  •  余生分开走
    2020-12-23 19:45

    Based heavily on the answer by davidovitch (thank you), I have put together a package that reads in a .ods file and returns a DataFrame. It's not a full implementation in pandas itself, such as his PR, but it provides a simple read_ods function that does the job.

    You can install it with pip install pandas_ods_reader. It's also possible to specify whether the file contains a header row or not, and to specify custom column names.

提交回复
热议问题