pandas.io.formats.style.Styler.export
- Styler.export()
Export the styles applied to the current Styler.
Can be applied to a second Styler with
Styler.use.- Returns:
- dict
Export the styles applied to the current Styler.
Can be applied to a second Styler with Styler.use.
Styler.useSet the styles on the current Styler.
Styler.copyCreate a copy of the current Styler.
This method is designed to copy non-data dependent attributes of
one Styler to another. It differs from Styler.copy where data and
data dependent attributes are also copied.
The following items are exported since they are not generally data dependent:
Styling functions added by the
applyandmapWhether axes and names are hidden from the display, if unambiguous.
Table attributes
Table styles
The following attributes are considered data dependent and therefore not exported:
Caption
UUID
Tooltips
Any hidden rows or columns identified by Index labels
Any formatting applied using
Styler.formatAny CSS classes added using
Styler.set_td_classes
>>> styler = pd.DataFrame([[1, 2], [3, 4]]).style
>>> styler2 = pd.DataFrame([[9, 9, 9]]).style
>>> styler.hide(axis=0).highlight_max(axis=1)
>>> export = styler.export()
>>> styler2.use(export)