Skip to content

DOC: Changed from_custom_template example #54374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -3602,13 +3602,12 @@ def from_custom_template(

Examples
--------
>>> from pandas.io.formats.style import Styler # doctest: +SKIP
>>> from IPython.display import HTML # doctest: +SKIP
>>> df = pd.DataFrame({"A": [1, 2]}) # doctest: +SKIP
>>> path = "path/to/template" # doctest: +SKIP
>>> file = "template.tpl" # doctest: +SKIP
>>> EasyStyler = Styler.from_custom_template(path, file) # doctest: +SKIP
>>> HTML(EasyStyler(df).to_html(table_title="Another Title")) # doctest: +SKIP
>>> from pandas.io.formats.style import Styler
>>> EasyStyler = Styler.from_custom_template("path/to/template",
... "template.tpl",
... ) # doctest: +SKIP
>>> df = pd.DataFrame({"A": [1, 2]})
>>> EasyStyler(df) # doctest: +SKIP

Please see:
`Table Visualization <../../user_guide/style.ipynb>`_ for more examples.
Expand Down