我在哪里可以找到ExcelWriter文档

时间:2023-02-11 15:09:53

I want to work with the ExcelWriter class. Though the ExcelWriter can be called with pd.ExcelWriter like in this post, I can't find any information about it in the Pandas API. So where can I find a documentation?

我想使用ExcelWriter类。尽管可以使用pd.ExcelWriter调用ExcelWriter,但在Pandas API中我找不到任何有关它的信息。那我在哪里可以找到文档?

1 个解决方案

#1


4  

You may want to read "Working with Python Pandas and XlsxWriter" documentation and Pandas Cookbook IO (Excel).

您可能需要阅读“使用Python Pandas和XlsxWriter”文档和Pandas Cookbook IO(Excel)。

Another useful option is to use interactive Python shells like ipython or Jupyter Notebook - just type function/method/constructor name followed by ? (question mark) and press Enter - it'll show you a docstring.

另一个有用的选择是使用交互式Python shell,如ipython或Jupyter Notebook - 只需键入function / method / constructor name,然后输入? (问号)然后按Enter键 - 它会显示一个文档字符串。

Demo in ipython:

ipython中的演示:

In [84]: pd.ExcelWriter?
Init signature: pd.ExcelWriter(path, engine=None, **kwargs)
Docstring:
Class for writing DataFrame objects into excel sheets, default is to use
xlwt for xls, openpyxl for xlsx.  See DataFrame.to_excel for typical usage.

Parameters
----------
path : string
    Path to xls or xlsx file.
engine : string (optional)
    Engine to use for writing. If None, defaults to
    ``io.excel.<extension>.writer``.  NOTE: can only be passed as a keyword
    argument.
date_format : string, default None
    Format string for dates written into Excel files (e.g. 'YYYY-MM-DD')
datetime_format : string, default None
    Format string for datetime objects written into Excel files
    (e.g. 'YYYY-MM-DD HH:MM:SS')

Notes
-----
For compatibility with CSV writers, ExcelWriter serializes lists
and dicts to strings before writing.

#1


4  

You may want to read "Working with Python Pandas and XlsxWriter" documentation and Pandas Cookbook IO (Excel).

您可能需要阅读“使用Python Pandas和XlsxWriter”文档和Pandas Cookbook IO(Excel)。

Another useful option is to use interactive Python shells like ipython or Jupyter Notebook - just type function/method/constructor name followed by ? (question mark) and press Enter - it'll show you a docstring.

另一个有用的选择是使用交互式Python shell,如ipython或Jupyter Notebook - 只需键入function / method / constructor name,然后输入? (问号)然后按Enter键 - 它会显示一个文档字符串。

Demo in ipython:

ipython中的演示:

In [84]: pd.ExcelWriter?
Init signature: pd.ExcelWriter(path, engine=None, **kwargs)
Docstring:
Class for writing DataFrame objects into excel sheets, default is to use
xlwt for xls, openpyxl for xlsx.  See DataFrame.to_excel for typical usage.

Parameters
----------
path : string
    Path to xls or xlsx file.
engine : string (optional)
    Engine to use for writing. If None, defaults to
    ``io.excel.<extension>.writer``.  NOTE: can only be passed as a keyword
    argument.
date_format : string, default None
    Format string for dates written into Excel files (e.g. 'YYYY-MM-DD')
datetime_format : string, default None
    Format string for datetime objects written into Excel files
    (e.g. 'YYYY-MM-DD HH:MM:SS')

Notes
-----
For compatibility with CSV writers, ExcelWriter serializes lists
and dicts to strings before writing.