Append another Styler to combine the output into a single table.
Added in version 1.5.0.
Parameters:
otherStyler
The other Styler object which has already been styled and formatted. The
data for this Styler must have the same columns as the original, and the
number of index levels must also be the same to render correctly.
Returns:
Styler
Notes
The purpose of this method is to extend existing styled dataframes with other
metrics that may be useful but may not conform to the original’s structure.
For example adding a sub total row, or displaying metrics such as means,
variance or counts.
Styles that are applied using the apply, map, apply_index
and map_index, and formatting applied with format and
format_index will be preserved.
Warning
Only the output methods to_html, to_string and to_latex
currently work with concatenated Stylers.
Other output methods, including to_excel, do not work with
concatenated Stylers.
The following should be noted:
table_styles, table_attributes, caption and uuid are all
inherited from the original Styler and not other.
hidden columns and hidden index levels will be inherited from the
original Styler
css will be inherited from the original Styler, and the value of
keys data, row_heading and row will be prepended with
foot0_. If more concats are chained, their styles will be prepended
with foot1_, ‘’foot_2’’, etc., and if a concatenated style have
another concatanated style, the second style will be prepended with
foot{parent}_foot{child}_.
A common use case is to concatenate user defined functions with
DataFrame.agg or with described statistics via DataFrame.describe.
See examples.
Examples
A common use case is adding totals rows, or otherwise, via methods calculated
in DataFrame.agg.