pandas.io.formats.style.Styler.use — pandas 2.2.3 documentation (original) (raw)
Set the styles on the current Styler.
Possibly uses styles from Styler.export
.
Parameters:
stylesdict(str, Any)
List of attributes to add to Styler. Dict keys should contain only:
- “apply”: list of styler functions, typically added with
apply
ormap
. - “table_attributes”: HTML attributes, typically added with
set_table_attributes
. - “table_styles”: CSS selectors and properties, typically added with
set_table_styles
. - “hide_index”: whether the index is hidden, typically added with
hide_index
, or a boolean list for hidden levels. - “hide_columns”: whether column headers are hidden, typically added with
hide_columns
, or a boolean list for hidden levels. - “hide_index_names”: whether index names are hidden.
- “hide_column_names”: whether column header names are hidden.
- “css”: the css class names used.
Returns:
Styler
See also
Export the non data dependent attributes to the current Styler.
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)