-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Styler.format_index()
to display index values similarly to data-values with format()
#43101
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
Styler.format_index()
to display index values similarly to data-values with format()
# Conflicts: # pandas/io/formats/templates/html_table.tpl
hmm why do we want to add methods like this? e.g. if you want to string format an index you can already |
Do throw this out to the team for feedback... |
Styler.format_index()
to display index values similarly to data-values with format()
Styler.format_index()
to display index values similarly to data-values with format()
Styler.format_index()
to display index values similarly to data-values with format()
Styler.format_index()
to display index values similarly to data-values with format()
pandas/io/formats/style_render.py
Outdated
---------- | ||
formatter : str, callable, dict or None | ||
Object to define how values are displayed. See notes. | ||
axis : int, str |
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.
give the allowed (e.g. 0,1,index,columns)
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.
done
# Conflicts: # pandas/io/formats/style_render.py
cf60e44
to
06ce6bf
Compare
# Conflicts: # pandas/io/formats/style_render.py
these tests consistently fail running the ipython in |
hmm, did dask version change? |
# Conflicts: # pandas/io/formats/style_render.py
looks like some actual doc failures: https://github.com/pandas-dev/pandas/pull/43101/checks?check_run_id=3570623205 |
everytime says The docs build locally without warning so I am puzzled, will see if I can come up with anything |
# Conflicts: # pandas/io/formats/style_render.py
@jreback managed to get this to pass after merge. revert if necessary but I think should be ok now. |
ok great. very odd that that was happening, |
This PR adds the method
format_index
so that the typicalformat
routines can also be applied to display the index labels and columns headers of a Styler.With all the recent functionality here is a complete example:
Notes
Also had to move
_refactor_levels
function fromstyle.py
tostyle_render.py
for use here.