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, name)

Factory function for creating a subclass of Styler.

Style application

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

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

Styler.applymap(self, func[, subset])

Apply a function elementwise.

Styler.where(self, cond, value[, other, subset])

Apply a function elementwise.

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

Format the text display value of cells.

Styler.set_precision(self, precision)

Set the precision used to render.

Styler.set_table_styles(self, table_styles)

Set the table styles on a Styler.

Styler.set_table_attributes(self, attributes)

Set the table attributes.

Styler.set_caption(self, caption)

Set the caption on a Styler.

Styler.set_properties(self[, subset])

Method to set one or more non-data dependent properties or each cell.

Styler.set_uuid(self, uuid)

Set the uuid for a Styler.

Styler.set_na_rep(self, na_rep)

Set the missing data representation on a Styler.

Styler.clear(self)

Reset the styler, removing any previously applied styles.

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

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

Builtin styles

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

Highlight the maximum by shading the background.

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

Highlight the minimum by shading the background.

Styler.highlight_null(self[, null_color])

Shade the background null_color for missing values.

Styler.background_gradient(self[, cmap, …])

Color the background in a gradient style.

Styler.bar(self[, subset, axis, color, …])

Draw bar chart in the cell backgrounds.

Style export and import

Styler.render(self, \*\*kwargs)

Render the built up styles to HTML.

Styler.export(self)

Export the styles to applied to the current Styler.

Styler.use(self, styles)

Set the styles on the current Styler.

Styler.to_excel(self, excel_writer[, …])

Write Styler to an Excel sheet.