From aa76f9b569ea1153e7bececf40870f224c9990a5 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 8 Sep 2022 20:44:11 +0200 Subject: [PATCH] Backport PR #48416: REF: ensure to apply suffixes before concat step in merge code --- pandas/core/reshape/merge.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 159ab33a8a04f..fe51230961327 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -764,8 +764,9 @@ def _reindex_and_concat( from pandas import concat + left.columns = llabels + right.columns = rlabels result = concat([left, right], axis=1, copy=copy) - result.columns = llabels.append(rlabels) return result def get_result(self, copy: bool = True) -> DataFrame: