-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I'm trying to summarize some percentages along with counts providing context.
I considered the following options to merge the 2 (in my case 2 * N) columns:
- Wrap them in a custom object (with it's own repr) but that wouldn't work with GT(?).
- Serialize them as a string (with the same formatting I'd use in repr above) but that wouldn't work with data_color (though I suppose I could write my own helper using tab_style or something).
- Use gt_merge_stack (just came across it), which seems to be working well with data_color (great!) but seems to be breaking at least autocolor_text and fmt_number.
Are there any other solutions to what I'm trying to do? If not, do you think this is a reasonable feature request?
Example:
(
GT(pl.DataFrame(dict(a=[1 / 2, 2 / 3, 3 / 4, 4 / 5], b=[4] * 4)))
.data_color(c.a, palette="GnBu")
)
(
GT(pl.DataFrame(dict(a=[1 / 2, 2 / 3, 3 / 4, 4 / 5], b=[4] * 4)))
.pipe(gte.gt_merge_stack, c.a, c.b)
.data_color(c.a, palette="GnBu")
)
^ Notice the difference in precision and text colors (I do realize gt_merge_stack has it's own colors and is likely overriding colors from data_color, but I hope they can be made to work well with each other).
Metadata
Metadata
Assignees
Labels
No labels