Skip to content

DOC: no docs for ExcelWriter engine_kwargs #42292 #42214 #43440

Closed
@feefladder

Description

@feefladder

  • I have checked that the issue still exists on the latest versions of the docs on master here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.ExcelWriter.html?highlight=excelwriter#pandas.ExcelWriter

Documentation problem

There is no use-case specified for engine_kwargs, as a result of which I was confused and made #42214. There, my test was overwritten by #42292 that uses the 'correct' use of engine_kwargs. How I did it first (incorrect):

import pandas as pd
with pd.ExcelWriter("file.xlsx",engine="xlsxwriter",engine_kwargs={"strings_to_formulas":False}) as writer:
    pd.DataFrame(["=1+1"]).to_excel(writer)

where it should have been:

import pandas as pd
with pd.ExcelWriter("file.xlsx",engine="xlsxwriter",engine_kwargs={"options":{"strings_to_formulas":False}}) as writer:
    pd.DataFrame(["=1+1"]).to_excel(writer)

However, since only xlsxwriter actually passes the engine_kwargs through to the Workbook class, this is unintuitive without documentation.

Suggested fix for documentation

I will submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions