Skip to content

How to do a row wise data_color domain? #598

Closed Answered by SamEdwardes
SamEdwardes asked this question in Q&A
Discussion options

You must be logged in to vote

I found a solution that works. You can iterate over each row and add colour to the row:

import polars as pl
from great_tables import GT, loc, style

data = pl.DataFrame(
    {
        "category_name": ["groceries", "dining out"],
        "group_name": ["Daily", "Daily"],
        "Mar 2024": [577.95, 460.96000000000004],
        "Apr 2024": [1286.5700000000002, 492.48],
        "May 2024": [1290.26, 845.2500000000001],
        "Jun 2024": [950.0300000000001, 637.59],
        "Jul 2024": [993.1999999999999, 806.2000000000002],
        "Aug 2024": [975.6599999999999, 479.18999999999994],
        "Sep 2024": [1543.16, 558.7199999999999],
        "Oct 2024": [682.6499999999999, 787.63],
        

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SamEdwardes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant