zip(level_lengths, columns.levels, columns.codes)
):
values = levels.take(level_codes)
for i, span_val in spans.items():
spans_multiple_cells = span_val > 1
yield ExcelCell(
row=lnum,
col=coloffset + i + 1,
val=values[i],
style=self.header_style,
mergestart=lnum if spans_multiple_cells else None,
mergeend=(
coloffset + i + span_val if spans_multiple_cells else None
),
)
else:
// Format in legacy format with dots to indicate levels.