You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So that works to add a new entry to the hoverlabel with label "index" but in my use-case is that in wide-form the index of df is used by default (in this case it's called "date") and I can't format that hover entry:
Or more generally: hover_data={df.index.name: ("|%Y", df.index)} ... pretty obscure tho! Not sure where to document that one.
Yes the reference to the general syntax for the formatting part of the tuple would be very appreciated. I finally found that the correct syntax for a literal string was {"index": (df.index)} but I had to fumble a lot.
Activity
emmanuelle commentedon Sep 10, 2020
The syntax is
Is this what you were asking? The keys of the
hover_datadict need to be str or numbers.nicolaskruchten commentedon Sep 10, 2020
So that works to add a new entry to the hoverlabel with label "index" but in my use-case is that in wide-form the index of
dfis used by default (in this case it's called"date") and I can't format that hover entry:nicolaskruchten commentedon Sep 10, 2020
Ah but you're totally right, this does work:
nicolaskruchten commentedon Sep 10, 2020
Or more generally:
hover_data={df.index.name: ("|%Y", df.index)}... pretty obscure tho! Not sure where to document that one.imadcat commentedon Nov 1, 2022
this works for single index, what about multiple index?
rabyj commentedon May 31, 2023
Yes the reference to the general syntax for the formatting part of the tuple would be very appreciated. I finally found that the correct syntax for a literal string was
{"index": (df.index)}but I had to fumble a lot.