Skip to content

DOC: Correct default color #48775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _mpl(func: Callable) -> Generator[tuple[Any, Any], None, None]:
CSS properties to use for highlighting. If ``props`` is given, ``color``
is not used."""

color = """color : str, default 'yellow'
color = """color : str, default '{default}'
Background color to use for highlighting."""

buf = """buf : str, path object, file-like object, optional
Expand Down Expand Up @@ -3335,7 +3335,7 @@ def bar(

return self

@Substitution(subset=subset, props=props, color=color)
@Substitution(subset=subset, props=props, color=color.format(default="red"))
def highlight_null(
self,
color: str | None = None,
Expand Down Expand Up @@ -3397,7 +3397,7 @@ def f(data: DataFrame, props: str) -> np.ndarray:
props = f"background-color: {color};"
return self.apply(f, axis=None, subset=subset, props=props)

@Substitution(subset=subset, color=color, props=props)
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
def highlight_max(
self,
subset: Subset | None = None,
Expand Down Expand Up @@ -3441,7 +3441,7 @@ def highlight_max(
props=props,
)

@Substitution(subset=subset, color=color, props=props)
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
def highlight_min(
self,
subset: Subset | None = None,
Expand Down Expand Up @@ -3485,7 +3485,7 @@ def highlight_min(
props=props,
)

@Substitution(subset=subset, color=color, props=props)
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
def highlight_between(
self,
subset: Subset | None = None,
Expand Down Expand Up @@ -3589,7 +3589,7 @@ def highlight_between(
inclusive=inclusive,
)

@Substitution(subset=subset, color=color, props=props)
@Substitution(subset=subset, color=color.format(default="yellow"), props=props)
def highlight_quantile(
self,
subset: Subset | None = None,
Expand Down