Skip to content

Commit f8ac978

Browse files
committed
Update basic-styling.qmd
1 parent 2400d52 commit f8ac978

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/get-started/basic-styling.qmd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,11 @@ In the next few sections, we'll first show how this combines nicely with the [`c
8686
One common approach is to specify a style from a column, and then hide that column in the final output. For example, we can add a background column to our `airquality` data:
8787

8888
```{python}
89-
color_map = {
90-
True: "lightyellow",
91-
False: "lightblue"
92-
}
89+
cond = air_head["Temp"].gt(70)
9390
9491
with_color = air_head.assign(
95-
background=(air_head["Temp"] > 70).replace(color_map)
92+
background=air_head["Temp"].case_when(caselist=[(cond, "lightyellow"),
93+
(~cond, "lightblue")])
9694
)
9795
9896
with_color

0 commit comments

Comments
 (0)