Skip to content

Commit

Permalink
DOCS: base to_excel docstring template extended for pandas.io.formats…
Browse files Browse the repository at this point in the history
….style.Styler.to_excel
  • Loading branch information
hlakams committed Aug 26, 2024
1 parent 54d43a8 commit 175dd36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2123,11 +2123,13 @@ def _repr_data_resource_(self):
klass="object",
storage_options=_shared_docs["storage_options"],
storage_options_versionadded="1.2.0",
encoding_parameter="",
verbose_parameter="",
extra_parameters=textwrap.dedent(
"""\
engine_kwargs : dict, optional
Arbitrary keyword arguments passed to excel engine.
"""
"""
),
)
def to_excel(
Expand Down Expand Up @@ -2196,9 +2198,11 @@ def to_excel(
merge_cells : bool, default True
Write MultiIndex and Hierarchical Rows as merged cells.
{encoding_parameter}
inf_rep : str, default 'inf'
Representation for infinity (there is no native representation for
infinity in Excel).
{verbose_parameter}
freeze_panes : tuple of int (length 2), optional
Specifies the one-based bottommost row and rightmost column that
is to be frozen.
Expand Down
11 changes: 8 additions & 3 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,19 @@ def set_tooltips(
klass="Styler",
storage_options=_shared_docs["storage_options"],
storage_options_versionadded="1.5.0",
extra_parameters=textwrap.dedent(
encoding_parameter=textwrap.dedent(
"""\
encoding : str or None, default None
Unused parameter, present for compatibility.
"""
),
verbose_parameter=textwrap.dedent(
"""\
verbose : str, default True
Optional unused parameter, present for compatibility.
"""
),
extra_parameters="",
)
def to_excel(
self,
Expand All @@ -576,11 +581,11 @@ def to_excel(
startcol: int = 0,
engine: str | None = None,
merge_cells: ExcelWriterMergeCells = True,
encoding: str | None = None,
inf_rep: str = "inf",
verbose: bool = True,
freeze_panes: tuple[int, int] | None = None,
storage_options: StorageOptions | None = None,
encoding: str | None = None,
verbose: bool = True,
) -> None:
from pandas.io.formats.excel import ExcelFormatter

Expand Down

0 comments on commit 175dd36

Please sign in to comment.