Skip to content

Commit 3e2ec50

Browse files
authored
DOC: fix EX02 errors in docstrings (pandas-dev#51529)
1 parent ec210cc commit 3e2ec50

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

ci/code_checks.sh

-4
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
580580
pandas.api.types.is_sparse \
581581
pandas.api.types.is_string_dtype \
582582
pandas.api.types.is_unsigned_integer_dtype \
583-
pandas.io.formats.style.Styler.concat \
584-
pandas.io.formats.style.Styler.export \
585-
pandas.io.formats.style.Styler.set_td_classes \
586-
pandas.io.formats.style.Styler.use \
587583
pandas.plotting.andrews_curves \
588584
pandas.plotting.autocorrelation_plot \
589585
pandas.plotting.lag_plot \

pandas/io/formats/style.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def concat(self, other: Styler) -> Styler:
332332
A common use case is adding totals rows, or otherwise, via methods calculated
333333
in ``DataFrame.agg``.
334334
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]],
336336
... columns=["Mike", "Jim"],
337337
... index=["Mon", "Tue", "Wed", "Thurs", "Fri"])
338338
>>> styler = df.style.concat(df.agg(["sum"]).style) # doctest: +SKIP
@@ -359,7 +359,8 @@ def concat(self, other: Styler) -> Styler:
359359
When ``other`` has fewer index levels than the original Styler it is possible
360360
to extend the index in ``other``, with placeholder levels.
361361
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]]))
363364
>>> descriptors = df.agg(["sum"])
364365
>>> descriptors.index = pd.MultiIndex.from_product([[""], descriptors.index])
365366
>>> df.style.concat(descriptors.style) # doctest: +SKIP
@@ -1463,6 +1464,7 @@ def set_td_classes(self, classes: DataFrame) -> Styler:
14631464
14641465
Form of the output with new additional css classes,
14651466
1467+
>>> from pandas.io.formats.style import Styler
14661468
>>> df = pd.DataFrame([[1]])
14671469
>>> css = pd.DataFrame([["other-class"]])
14681470
>>> s = Styler(df, uuid="_", cell_ids=False).set_td_classes(css)
@@ -2067,8 +2069,8 @@ def export(self) -> dict[str, Any]:
20672069
Examples
20682070
--------
20692071
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
20722074
>>> styler.hide(axis=0).highlight_max(axis=1) # doctest: +SKIP
20732075
>>> export = styler.export()
20742076
>>> styler2.use(export) # doctest: +SKIP
@@ -2119,8 +2121,8 @@ def use(self, styles: dict[str, Any]) -> Styler:
21192121
Examples
21202122
--------
21212123
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
21242126
>>> styler.hide(axis=0).highlight_max(axis=1) # doctest: +SKIP
21252127
>>> export = styler.export()
21262128
>>> styler2.use(export) # doctest: +SKIP

0 commit comments

Comments
 (0)