From a86745e5d633d6f29d3a90606c3dab2238a11794 Mon Sep 17 00:00:00 2001 From: Vikram Kumar Date: Thu, 18 Dec 2025 13:46:22 +0530 Subject: [PATCH 1/2] Fix: removed unnecessary space --- pandas/core/reshape/concat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/reshape/concat.py b/pandas/core/reshape/concat.py index d5d7520366a2f..d97fa6aed4e8e 100644 --- a/pandas/core/reshape/concat.py +++ b/pandas/core/reshape/concat.py @@ -710,7 +710,8 @@ def _get_concat_axis_series( ) -> Index: """Return result concat axis when concatenating Series objects.""" if ignore_index: - return default_index(len(objs)) + total_length = sum(len(obj) for obj in objs) + return default_index(total_length) elif bm_axis == 0: indexes = [x.index for x in objs] if keys is None: From 4942bacc6f0648cb7429bc8404335b675aeed65f Mon Sep 17 00:00:00 2001 From: Vikram Kumar Date: Sun, 21 Dec 2025 15:08:32 +0530 Subject: [PATCH 2/2] Fix: Using bm_axis check --- pandas/core/reshape/concat.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/core/reshape/concat.py b/pandas/core/reshape/concat.py index d97fa6aed4e8e..bf4be60abe161 100644 --- a/pandas/core/reshape/concat.py +++ b/pandas/core/reshape/concat.py @@ -710,8 +710,12 @@ def _get_concat_axis_series( ) -> Index: """Return result concat axis when concatenating Series objects.""" if ignore_index: - total_length = sum(len(obj) for obj in objs) - return default_index(total_length) +- total_length = sum(len(obj) for obj in objs) ++ if bm_axis: ++ total_length = len(objs) ++ else: ++ total_length = sum(len(obj) for obj in objs) + return default_index(total_length) elif bm_axis == 0: indexes = [x.index for x in objs] if keys is None: