-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Conditional HTML styling hides MultiIndex structure #11655
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
Comments
IIRC this is 'not implemented', cc @TomAugspurger as wanted to get basic stuff working. patches are welcome! |
see last check box in #11610 |
MultiIndex
structure
Yep. This one isn't too bad to do, I just ran out of time. It's a matter of modifying the template to be aware of the index levels. |
@jreback ah I see, didn't read the post properly. I guess in that case this issue is redundant and can be closed. |
@mattilyra its fine. you can post a fix and directly reference this. |
this still open @TomAugspurger ? |
Yeah, still open. |
@TomAugspurger did you have a fix for this already? (even if not prod ready), just want to give a try. |
@jreback I can get something together tonight, if that's not too late. The basic idea is to use the logic in |
that would be totally fantastic! |
@jreback OK, the minimal version (1 whole test) is here: https://github.com/TomAugspurger/pandas/tree/style-sparse-mi-2 I'll see what refactoring I can do and submit a pull request sometime soonish. |
Ahh, only did index labels. Give me 20 minutes :) |
@jreback pushed 4655534 which fix it. https://gist.github.com/643402b241e6d945118942cb8ccff3ac Index names are messed up with a MultiIndex, but if you just set those to |
that looks great! thanks! I realize that the CSS injection can be done thru |
@TomAugspurger so this fixes the single level index case (I don't have a good repro :<
|
I noticed that the styling doesn't quite work with
MultiIndex
data frames. For example if we have a dataframe with two cross validated scores and take theirmean
andsem
usinggroupby
to get aMultiIndex
dataframewhere as without the styling the index names are preserved and the
score_1
andscore_2
column headers span 2 columns which improves legibility.The text was updated successfully, but these errors were encountered: