pandas.io.formats.style.Styler.set_uuid#

Styler.set_uuid(uuid)[source]#

Set the uuid applied to id attributes of HTML elements.

Parameters:
uuidstr
Returns:
Styler

Notes

Almost all HTML elements within the table, and including the <table> element are assigned id attributes. The format is T_uuid_<extra> where <extra> is typically a more specific identifier, such as row1_col2.

Examples

>>> df = pd.DataFrame([[1, 2], [3, 4]], index=['A', 'B'], columns=['c1', 'c2'])

You can get the id attributes with the following:

>>> print((df).style.to_html())  

To add a title to column c1, its id is T_20a7d_level0_col0:

>>> df.style.set_uuid("T_20a7d_level0_col0")
... .set_caption("Test")  

Please see: Table visualization for more examples.