We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbeeb1f commit 3e56700Copy full SHA for 3e56700
pandas/io/formats/excel.py
@@ -826,6 +826,9 @@ def _format_hierarchical_rows(self) -> Iterable[ExcelCell]:
826
fill_value=levels._na_value,
827
)
828
829
+ if isinstance(values, PeriodIndex):
830
+ values = values.to_timestamp()
831
+
832
for i, span_val in spans.items():
833
mergestart, mergeend = None, None
834
if span_val > 1:
@@ -849,6 +852,10 @@ def _format_hierarchical_rows(self) -> Iterable[ExcelCell]:
849
852
# Format hierarchical rows with non-merged values.
850
853
for indexcolvals in zip(*self.df.index):
851
854
for idx, indexcolval in enumerate(indexcolvals):
855
856
+ if isinstance(indexcolval, Period):
857
+ indexcolval = indexcolval.to_timestamp()
858
859
yield CssExcelCell(
860
row=self.rowcounter + idx,
861
col=gcolidx,
0 commit comments