Skip to content

Commit

Permalink
Update basic-styling.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
jrycw committed Nov 28, 2024
1 parent 2400d52 commit f8ac978
Showing 1 changed file with 3 additions and 5 deletions.
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

1 comment on commit f8ac978

@jrycw
Copy link
Collaborator Author

@jrycw jrycw commented on f8ac978 Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve found that I need to modify this example to pass the documentation build, which is an interesting discovery.

Please sign in to comment.