Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions docs/get-started/basic-styling.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ In the next few sections, we'll first show how this combines nicely with the [`c
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:

```{python}
color_map = {
True: "lightyellow",
False: "lightblue"
}
cond = air_head["Temp"].gt(70)

with_color = air_head.assign(
background=(air_head["Temp"] > 70).replace(color_map)
background=air_head["Temp"].case_when(caselist=[(cond, "lightyellow"),
(~cond, "lightblue")])
)

with_color
Expand Down
Loading
Loading