Reviewing Tim Hoffman's answer to this broader question made me want to make my headers wrap.
I tried this with the following code:
import pandas.core.format
pandas.core.format.header_style["alignment"].update({"text_wrap" : True})
pandas.core.format.header_style["font"].update({"bold" : False})
Now, the actual result is NOT bolded, so I know I'm managing to overwrite the default. However, the text is not wrapping.
Based on what I see in the xlsxwriter format class guide and that there's already an alignment keyword...
ipdb> pandas.core.format.header_style["alignment"]
{'horizontal': 'center', 'vertical': 'top'}
...and that after I modify it as per above...
ipdb> pandas.core.format.header_style["alignment"].update({"text_wrap" : True})
ipdb> pandas.core.format.header_style["alignment"]
{'horizontal': 'center', 'text_wrap': True, 'vertical': 'top'}
...I would expect to get the result, but I'm not. Anyone know why?
I gather that I could also re-write the data using an xlsxwriter write method, but that feels like more work to me, so I'm hoping to make it work this way.