pandas.io.formats.style.Styler.export — pandas 2.2.3 documentation (original) (raw)

Styler.export()[source]#

Export the styles applied to the current Styler.

Can be applied to a second Styler with Styler.use.

Returns:

dict

See also

Styler.use

Set the styles on the current Styler.

Styler.copy

Create a copy of the current Styler.

Notes

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:

The following attributes are considered data dependent and therefore not exported:

Examples

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)