Style

Styler objects are returned by pandas.DataFrame.style.

Styler constructor

Styler(data[, precision, table_styles, ...])

Helps style a DataFrame or Series according to the data with HTML and CSS.

Styler.from_custom_template(searchpath[, ...])

Factory function for creating a subclass of Styler.

Styler properties

Styler.env

Styler.template_html

Styler.template_html_style

Styler.template_html_table

Styler.template_latex

Styler.template_string

Styler.loader

Style application

Styler.apply(func[, axis, subset])

Apply a CSS-styling function column-wise, row-wise, or table-wise.

Styler.applymap(func[, subset])

Apply a CSS-styling function elementwise.

Styler.apply_index(func[, axis, level])

Apply a CSS-styling function to the index or column headers, level-wise.

Styler.applymap_index(func[, axis, level])

Apply a CSS-styling function to the index or column headers, elementwise.

Styler.format([formatter, subset, na_rep, ...])

Format the text display value of cells.

Styler.format_index([formatter, axis, ...])

Format the text display value of index labels or column headers.

Styler.relabel_index(labels[, axis, level])

Relabel the index, or column header, keys to display a set of specified values.

Styler.hide([subset, axis, level, names])

Hide the entire index / column headers, or specific rows / columns from display.

Styler.concat(other)

Append another Styler to combine the output into a single table.

Styler.set_td_classes(classes)

Set the class attribute of <td> HTML elements.

Styler.set_table_styles([table_styles, ...])

Set the table styles included within the <style> HTML element.

Styler.set_table_attributes(attributes)

Set the table attributes added to the <table> HTML element.

Styler.set_tooltips(ttips[, props, css_class])

Set the DataFrame of strings on Styler generating :hover tooltips.

Styler.set_caption(caption)

Set the text added to a <caption> HTML element.

Styler.set_sticky([axis, pixel_size, levels])

Add CSS to permanently display the index or column headers in a scrolling frame.

Styler.set_properties([subset])

Set defined CSS-properties to each <td> HTML element for the given subset.

Styler.set_uuid(uuid)

Set the uuid applied to id attributes of HTML elements.

Styler.clear()

Reset the Styler, removing any previously applied styles.

Styler.pipe(func, *args, **kwargs)

Apply func(self, *args, **kwargs), and return the result.

Builtin styles

Styler.highlight_null([color, subset, ...])

Highlight missing values with a style.

Styler.highlight_max([subset, color, axis, ...])

Highlight the maximum with a style.

Styler.highlight_min([subset, color, axis, ...])

Highlight the minimum with a style.

Styler.highlight_between([subset, color, ...])

Highlight a defined range with a style.

Styler.highlight_quantile([subset, color, ...])

Highlight values defined by a quantile with a style.

Styler.background_gradient([cmap, low, ...])

Color the background in a gradient style.

Styler.text_gradient([cmap, low, high, ...])

Color the text in a gradient style.

Styler.bar([subset, axis, color, cmap, ...])

Draw bar chart in the cell backgrounds.

Style export and import

Styler.to_html([buf, table_uuid, ...])

Write Styler to a file, buffer or string in HTML-CSS format.

Styler.to_latex([buf, column_format, ...])

Write Styler to a file, buffer or string in LaTeX format.

Styler.to_excel(excel_writer[, sheet_name, ...])

Write Styler to an Excel sheet.

Styler.to_string([buf, encoding, ...])

Write Styler to a file, buffer or string in text format.

Styler.export()

Export the styles applied to the current Styler.

Styler.use(styles)

Set the styles on the current Styler.