Skip to content

Commit

Permalink
docs: add polars example to from_column
Browse files Browse the repository at this point in the history
  • Loading branch information
machow committed Dec 13, 2023
1 parent 8c55a96 commit d7f918c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions great_tables/_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ class FromColumn:
style = style.text(color = from_column("color")),
locations = loc.body(columns = ["x"])
)
```
If you are using polars, you can just pass polars expressions in directly:
```{python}
import polars as pl
gt_polars = GT(pl.from_pandas(df))
gt_polars.tab_style(
style = style.text(color = pl.col("color")), # <-- polars expression
locations = loc.body(columns = ["x"])
)
```
"""

Expand Down

0 comments on commit d7f918c

Please sign in to comment.