File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -826,6 +826,9 @@ def _format_hierarchical_rows(self) -> Iterable[ExcelCell]:
826826 fill_value = levels ._na_value ,
827827 )
828828
829+ if isinstance (values , PeriodIndex ):
830+ values = values .to_timestamp ()
831+
829832 for i , span_val in spans .items ():
830833 mergestart , mergeend = None , None
831834 if span_val > 1 :
@@ -849,6 +852,10 @@ def _format_hierarchical_rows(self) -> Iterable[ExcelCell]:
849852 # Format hierarchical rows with non-merged values.
850853 for indexcolvals in zip (* self .df .index ):
851854 for idx , indexcolval in enumerate (indexcolvals ):
855+
856+ if isinstance (indexcolval , Period ):
857+ indexcolval = indexcolval .to_timestamp ()
858+
852859 yield CssExcelCell (
853860 row = self .rowcounter + idx ,
854861 col = gcolidx ,
You can’t perform that action at this time.
0 commit comments