Skip to content

Commit

Permalink
Temporary fix to allow row selection in data_color
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmi committed Apr 22, 2024
1 parent b4d102a commit cd6e909
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions great_tables/_data_color/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def data_color(
alpha: Optional[Union[int, float]] = None,
reverse: bool = False,
autocolor_text: bool = True,
rows: Optional[List[int]] = None,
) -> GTSelf:
"""
Perform data cell colorization.
Expand Down Expand Up @@ -198,6 +199,9 @@ def data_color(

# Get the internal data table
data_table = self._tbl_data
# Select only a subset of rows.
if rows:
data_table = data_table.copy().iloc[rows]

# If `columns` is a single value, convert it to a list; if it is None then
# get a list of all columns in the table body
Expand Down

0 comments on commit cd6e909

Please sign in to comment.