Skip to content

Commit 0eb6d33

Browse files
bashtageKevin Sheppard
and
Kevin Sheppard
authored
DOC: Correct default color (#48775)
Default color is not always yellow Co-authored-by: Kevin Sheppard <[email protected]>
1 parent e0608cb commit 0eb6d33

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/io/formats/style.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _mpl(func: Callable) -> Generator[tuple[Any, Any], None, None]:
105105
CSS properties to use for highlighting. If ``props`` is given, ``color``
106106
is not used."""
107107

108-
color = """color : str, default 'yellow'
108+
color = """color : str, default '{default}'
109109
Background color to use for highlighting."""
110110

111111
buf = """buf : str, path object, file-like object, optional
@@ -3335,7 +3335,7 @@ def bar(
33353335

33363336
return self
33373337

3338-
@Substitution(subset=subset, props=props, color=color)
3338+
@Substitution(subset=subset, props=props, color=color.format(default="red"))
33393339
def highlight_null(
33403340
self,
33413341
color: str | None = None,
@@ -3397,7 +3397,7 @@ def f(data: DataFrame, props: str) -> np.ndarray:
33973397
props = f"background-color: {color};"
33983398
return self.apply(f, axis=None, subset=subset, props=props)
33993399

3400-
@Substitution(subset=subset, color=color, props=props)
3400+
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
34013401
def highlight_max(
34023402
self,
34033403
subset: Subset | None = None,
@@ -3441,7 +3441,7 @@ def highlight_max(
34413441
props=props,
34423442
)
34433443

3444-
@Substitution(subset=subset, color=color, props=props)
3444+
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
34453445
def highlight_min(
34463446
self,
34473447
subset: Subset | None = None,
@@ -3485,7 +3485,7 @@ def highlight_min(
34853485
props=props,
34863486
)
34873487

3488-
@Substitution(subset=subset, color=color, props=props)
3488+
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
34893489
def highlight_between(
34903490
self,
34913491
subset: Subset | None = None,
@@ -3589,7 +3589,7 @@ def highlight_between(
35893589
inclusive=inclusive,
35903590
)
35913591

3592-
@Substitution(subset=subset, color=color, props=props)
3592+
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
35933593
def highlight_quantile(
35943594
self,
35953595
subset: Subset | None = None,

0 commit comments

Comments
 (0)