Open HHammond opened 8 years ago
+1 for setting cell background color based on value. I'm sure you've thought of these already, but some use cases: (1) set colour based on mapping from (categorical) values to colours; (2) set colour using colour map, with user able to provide vmin, vmax, cmap and possibly normalize arguments to control value to colour transformation; (3) set colour using threshold on value, eg, red if > 5. Would be amazing if prettypandas could support these!
There already is colour-map support and min, max background support in the Pandas API http://pandas.pydata.org/pandas-docs/stable/style.html#Building-Styles. They have some neat functionality implemented. Since PrettyPandas
subclasses pandas.core.Styler
we get all that stuff for free.
I do think if a negative value colour indicator isn't built into pandas core then it definitely belongs here.
Also I think I should include those examples in the documentation so that people are aware
Wow, I didn't know about that, perfect! Good idea to include an example in prettypandas docs.
On Thursday, 21 January 2016, Henry Hammond notifications@github.com wrote:
There already is colour-map support and min, max background support in the Pandas API http://pandas.pydata.org/pandas-docs/stable/style.html#Building-Styles. They have some neat functionality implemented. Since PrettyPandas subclasses pandas.core.Styler we get all that stuff for free.
I do think if a negative value colour indicator isn't built into pandas core then it definitely belongs here.
— Reply to this email directly or view it on GitHub https://github.com/HHammond/PrettyPandas/issues/18#issuecomment-173682083 .
Alistair Miles Head of Epidemiological Informatics Centre for Genomics and Global Health http://cggh.org The Wellcome Trust Centre for Human Genetics Roosevelt Drive Oxford OX3 7BN United Kingdom Web: http://purl.org/net/aliman Email: alimanfoo@googlemail.com alimanfoo@gmail.com Tel: +44 (0)1865 287721
Please consider using axis='columns', axis='index' instead of axis=0, axis=1 to win over people who don't have numpy background. Pandas api supports this as well. See:
set_font
set_background
- change cell background coloursset_alternating
- apply alternating even-odd coloursset_hover
- apply hover effectsset_cell_height
- set minimum cell heightset_cell_width
- set minimum cell widthdescribe
- add stats similar toDataFrame.describe()