@@ -987,11 +987,11 @@ def to_latex(
987987 hide the repeated level-0 of the index:
988988
989989 >>> (styler.format(subset="Equity", precision=2)
990- ... .format(subset="Stats", precision=1, thousands=",")
991- ... .format(subset="Rating", formatter=str.upper)
992- ... .format_index(escape="latex", axis=1)
993- ... .format_index(escape="latex", axis=0)
994- ... .hide(level=0, axis=0)) # doctest: +SKIP
990+ ... .format(subset="Stats", precision=1, thousands=",")
991+ ... .format(subset="Rating", formatter=str.upper)
992+ ... .format_index(escape="latex", axis=1)
993+ ... .format_index(escape="latex", axis=0)
994+ ... .hide(level=0, axis=0)) # doctest: +SKIP
995995
996996 Note that one of the string entries of the index and column headers is "H&M".
997997 Without applying the `escape="latex"` option to the `format_index` method the
@@ -1003,12 +1003,15 @@ def to_latex(
10031003 recommendation:
10041004
10051005 >>> def rating_color(v):
1006- ... if v == "Buy": color = "#33ff85"
1007- ... elif v == "Sell": color = "#ff5933"
1008- ... else: color = "#ffdd33"
1006+ ... if v == "Buy":
1007+ ... color = "#33ff85"
1008+ ... elif v == "Sell":
1009+ ... color = "#ff5933"
1010+ ... else:
1011+ ... color = "#ffdd33"
10091012 ... return f"color: {color}; font-weight: bold;"
10101013 >>> (styler.background_gradient(cmap="inferno", subset="Equity", vmin=0, vmax=1)
1011- ... .map(rating_color, subset="Rating")) # doctest: +SKIP
1014+ ... .map(rating_color, subset="Rating")) # doctest: +SKIP
10121015
10131016 All the above styles will work with HTML (see below) and LaTeX upon conversion:
10141017
0 commit comments