-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix Styler._translate failing on numeric columns #12126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tests! and u can use .iloc[r, c] |
I'm working on the tests right now, just trying to figure out the best way to do "doesn't raise error" without comparing it to the output dictionary. Didn't know about the |
daf703f
to
b7501b0
Compare
df = pd.DataFrame({0: [1, 2, 3]}) | ||
df.style._translate() | ||
|
||
self.assertTrue(True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best way to assert that the code successfully ran without error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no just put a comment that this is a smoke test
if an exception is raised the test fails
895a18b
to
b31619c
Compare
Added test
b31619c
to
eb0acac
Compare
I've got a branch that changes the template and translate around a bit to be cleaner. I'll push that later today when I'm at a computer and see how it messes up yourPR here. |
Let me know what happens and I'll rebase form your PR if this still exists. |
It might be worth keeping the test case anyway. |
Styler._translate
failing on numeric columns
@HHammond I have got that change included on this branch. I've cherry-picked your test, thanks. I should have that branch wrapped up sometime this week. |
Sounds good. Is it time to close this PR? |
Sure, we'll leave the issue open though. Thanks. |
Closes pandas-dev#11692 Closes pandas-dev#12134 Closes pandas-dev#12125 This adds a `.format` method to Styler for formatting the display value (the actual text) of each scalar value. In the processes of cleaning up the template, I close pandas-dev#12134 (spurious 0) and pandas-dev#12125 (KeyError from using iloc improperly) cherry pick test from pandas-dev#12126 only allow str formatting for now fix tests for new spec formatter callable update notebook
Closes pandas-dev#11692 Closes pandas-dev#12134 Closes pandas-dev#12125 This adds a `.format` method to Styler for formatting the display value (the actual text) of each scalar value. In the processes of cleaning up the template, I close pandas-dev#12134 (spurious 0) and pandas-dev#12125 (KeyError from using iloc improperly) cherry pick test from pandas-dev#12126 only allow str formatting for now fix tests for new spec formatter callable update notebook
Closes pandas-dev#11692 Closes pandas-dev#12134 Closes pandas-dev#12125 This adds a `.format` method to Styler for formatting the display value (the actual text) of each scalar value. In the processes of cleaning up the template, I close pandas-dev#12134 (spurious 0) and pandas-dev#12125 (KeyError from using iloc improperly) cherry pick test from pandas-dev#12126 only allow str formatting for now fix tests for new spec formatter callable update notebook
Addresses #12125.
The previous behaviour was to use a
__getitem__
lookup which caused incorrect behaviour with numeric columns. The adjusted code usesiloc
numerical indexing to resolve the issue.