@@ -332,7 +332,7 @@ def concat(self, other: Styler) -> Styler:
332
332
A common use case is adding totals rows, or otherwise, via methods calculated
333
333
in ``DataFrame.agg``.
334
334
335
- >>> df = DataFrame([[4, 6], [1, 9], [3, 4], [5, 5], [9,6]],
335
+ >>> df = pd. DataFrame([[4, 6], [1, 9], [3, 4], [5, 5], [9,6]],
336
336
... columns=["Mike", "Jim"],
337
337
... index=["Mon", "Tue", "Wed", "Thurs", "Fri"])
338
338
>>> styler = df.style.concat(df.agg(["sum"]).style) # doctest: +SKIP
@@ -359,7 +359,8 @@ def concat(self, other: Styler) -> Styler:
359
359
When ``other`` has fewer index levels than the original Styler it is possible
360
360
to extend the index in ``other``, with placeholder levels.
361
361
362
- >>> df = DataFrame([[1], [2]], index=pd.MultiIndex.from_product([[0], [1, 2]]))
362
+ >>> df = pd.DataFrame([[1], [2]],
363
+ ... index=pd.MultiIndex.from_product([[0], [1, 2]]))
363
364
>>> descriptors = df.agg(["sum"])
364
365
>>> descriptors.index = pd.MultiIndex.from_product([[""], descriptors.index])
365
366
>>> df.style.concat(descriptors.style) # doctest: +SKIP
@@ -1463,6 +1464,7 @@ def set_td_classes(self, classes: DataFrame) -> Styler:
1463
1464
1464
1465
Form of the output with new additional css classes,
1465
1466
1467
+ >>> from pandas.io.formats.style import Styler
1466
1468
>>> df = pd.DataFrame([[1]])
1467
1469
>>> css = pd.DataFrame([["other-class"]])
1468
1470
>>> s = Styler(df, uuid="_", cell_ids=False).set_td_classes(css)
@@ -2067,8 +2069,8 @@ def export(self) -> dict[str, Any]:
2067
2069
Examples
2068
2070
--------
2069
2071
2070
- >>> styler = DataFrame([[1, 2], [3, 4]]).style
2071
- >>> styler2 = DataFrame([[9, 9, 9]]).style
2072
+ >>> styler = pd. DataFrame([[1, 2], [3, 4]]).style
2073
+ >>> styler2 = pd. DataFrame([[9, 9, 9]]).style
2072
2074
>>> styler.hide(axis=0).highlight_max(axis=1) # doctest: +SKIP
2073
2075
>>> export = styler.export()
2074
2076
>>> styler2.use(export) # doctest: +SKIP
@@ -2119,8 +2121,8 @@ def use(self, styles: dict[str, Any]) -> Styler:
2119
2121
Examples
2120
2122
--------
2121
2123
2122
- >>> styler = DataFrame([[1, 2], [3, 4]]).style
2123
- >>> styler2 = DataFrame([[9, 9, 9]]).style
2124
+ >>> styler = pd. DataFrame([[1, 2], [3, 4]]).style
2125
+ >>> styler2 = pd. DataFrame([[9, 9, 9]]).style
2124
2126
>>> styler.hide(axis=0).highlight_max(axis=1) # doctest: +SKIP
2125
2127
>>> export = styler.export()
2126
2128
>>> styler2.use(export) # doctest: +SKIP
0 commit comments