twosigma / twosigma/beakerx

Table setFontColorProvider is off by one

Open
#8,194 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
2.9k
Forks
383
PR merge metrics
No merged PRs in 30d

Description

Hello,

I needed to fiddle around with the function to avoid being off by one when returning a Color for a cell like this

```python
table = TableDisplay(df)
table.setStringFormatForTimes(TimeUnit.DAYS)

def color_provider(row, column, table):
row = table.values[row]
if column < len(row) - 1:
val = row[column + 1]
if val is 3:
return Color.GREEN
return Color.BLACK

table.setFontColorProvider(color_provider)

table
```

is there another attribute than `table.values` that is meant to be used for that or is it just off by one?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.