pandas.io.formats.style.Styler.render
- Styler.render(sparse_index=None, sparse_columns=None, **kwargs)[source]
-
Render the
Styler
including all applied styles to HTML.- Parameters
-
- sparse_index:bool, optional
-
Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. Defaults to
pandas.options.styler.sparse.index
value. - sparse_columns:bool, optional
-
Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. Defaults to
pandas.options.styler.sparse.columns
value. - **kwargs
-
Any additional keyword arguments are passed through to
self.template.render
. This is useful when you need to provide additional variables for a custom template.
- Returns
-
- rendered:str
-
The rendered HTML.
Notes
Styler objects have defined the
_repr_html_
method which automatically callsself.render()
when it’s the last item in a Notebook cell. When callingStyler.render()
directly, wrap the result inIPython.display.HTML
to view the rendered HTML in the notebook.Pandas uses the following keys in render. Arguments passed in
**kwargs
take precedence, so think carefully if you want to override them:head
cellstyle
body
uuid
table_styles
caption
table_attributes
© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.io.formats.style.Styler.render.html