ENH: Add support for tablewise application of style.background_gradient with axis=None#21259
Conversation
|
Hello @soxofaan! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on July 11, 2018 at 15:48 Hours UTC |
060fd66 to
b1dfa6c
Compare
pandas/io/formats/style.py
Outdated
| with _mpl(Styler.background_gradient) as (plt, colors): | ||
| rng = s.max() - s.min() | ||
| min = s.values.min() | ||
| max = s.values.max() |
There was a problem hiding this comment.
Can you use different names for min/max so they don't override the built-in min/max functions?
There was a problem hiding this comment.
sure, updated commit
b1dfa6c to
e376312
Compare
Codecov Report
@@ Coverage Diff @@
## master #21259 +/- ##
==========================================
+ Coverage 91.92% 91.92% +<.01%
==========================================
Files 160 160
Lines 49906 49910 +4
==========================================
+ Hits 45875 45879 +4
Misses 4031 4031
Continue to review full report at Codecov.
|
e376312 to
e6f7758
Compare
|
@jschendel I updated the commit per your request the failing tests/checks are not related to the change as far as I understand, is there something I should do about that? |
|
you have linting issues: pandas/tests/io/formats/test_style.py:1066:1: E303 too many blank lines (3) |
|
is it worth adding the OP example here? |
e6f7758 to
5c05bf1
Compare
|
@jreback thanks, I didn't catch that linting issue warning. Lot of trees in the forest. I think the OP example is good for interactive testing, but overkill for unit testing |
5c05bf1 to
23a4bfb
Compare
|
(this PR will conflict with #21263 ) |
23a4bfb to
0f2b688
Compare
0f2b688 to
5322f25
Compare
doc/source/whatsnew/v0.24.0.txt
Outdated
| - :func:`to_csv` now supports ``compression`` keyword when a file handle is passed. (:issue:`21227`) | ||
| - :meth:`Index.droplevel` is now implemented also for flat indexes, for compatibility with MultiIndex (:issue:`21115`) | ||
|
|
||
| - Allow elementwise coloring in ``style.background_gradient`` with ``axis=None`` (:issue:`15204`) |
There was a problem hiding this comment.
use :class:`pandas.io.formats.style.Styler`
There was a problem hiding this comment.
or even better, I'll move it alongside with the changelog entry for PR #21263
5322f25 to
f044cf7
Compare
|
|
f044cf7 to
d615e90
Compare
|
😕 now |
d615e90 to
c39f420
Compare
|
(rebased on latest master) |
|
Thanks! |

git diff upstream/master -u -- "*.py" | flake8 --diff