From b75df20a5d85fee57837fbf57253aeb0c8f89e04 Mon Sep 17 00:00:00 2001 From: ZKaoChi <1953542921@qq.com> Date: Mon, 11 Nov 2024 14:22:37 +0800 Subject: [PATCH 1/3] DOC: Make document merge_cells=columns in to_excel --- pandas/core/generic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 35014674565ff..76cc4ed641b80 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2211,8 +2211,10 @@ def to_excel( via the options ``io.excel.xlsx.writer`` or ``io.excel.xlsm.writer``. - merge_cells : bool, default True - Write MultiIndex and Hierarchical Rows as merged cells. + merge_cells : bool or 'columns', default False + Write MultiIndex and Hierarchical Rows as merged cells if True. + Merge MultiIndex column header cells only if 'columns'. + {encoding_parameter} inf_rep : str, default 'inf' Representation for infinity (there is no native representation for From c461a74d3f951f7bb7bf75a8cd894b6a0583f23b Mon Sep 17 00:00:00 2001 From: ZKaoChi <1953542921@qq.com> Date: Mon, 11 Nov 2024 14:25:01 +0800 Subject: [PATCH 2/3] DOC: Make document merge_cells=columns in to_excel --- pandas/core/generic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 76cc4ed641b80..4c11c285c292e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2214,7 +2214,6 @@ def to_excel( merge_cells : bool or 'columns', default False Write MultiIndex and Hierarchical Rows as merged cells if True. Merge MultiIndex column header cells only if 'columns'. - {encoding_parameter} inf_rep : str, default 'inf' Representation for infinity (there is no native representation for From 42cc7714657740e3832215043982c09ffea82426 Mon Sep 17 00:00:00 2001 From: ZKaoChi <1953542921@qq.com> Date: Tue, 12 Nov 2024 10:05:25 +0800 Subject: [PATCH 3/3] Modify the description --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 4c11c285c292e..3a83a3997f881 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2212,8 +2212,8 @@ def to_excel( ``io.excel.xlsm.writer``. merge_cells : bool or 'columns', default False - Write MultiIndex and Hierarchical Rows as merged cells if True. - Merge MultiIndex column header cells only if 'columns'. + If True, write MultiIndex index and columns as merged cells. + If 'columns', merge MultiIndex column cells only. {encoding_parameter} inf_rep : str, default 'inf' Representation for infinity (there is no native representation for