Closed
Description
df = pd.DataFrame({"a": [1, 1], "b": [2, 3], "c": 4, "d": 5}).set_index(["a", "b"])
df.columns = pd.MultiIndex.from_tuples([("x", "y"), ("x", "z")])
df.to_excel("test.xlsx", merge_cells=False)
In the above the multi-level nature of the index is maintained, however the columns are collapsed to a single row in the form x.y, x.z
. It seems to me that these should be treated the same. The output should be multiple rows of non-merged cells.