Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5422,7 +5422,7 @@ def _concat(self, to_concat: list[Index], name: Hashable) -> Index:

result = concat_compat(to_concat_vals)

return Index._with_infer(result, name=name)
return Index._with_infer(result, name=name, copy=False)

def putmask(self, mask, value) -> Index:
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ def _concat(self, indexes: list[Index], name: Hashable) -> Index:
)
else:
values = np.concatenate([x._values for x in rng_indexes])
result = self._constructor(values)
result = self._constructor(values, copy=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a similar self._constructor(values) call a few lines above at 1234, where you can add a copy=False as well, I think

return result.rename(name)

if step is not None:
Expand Down
Loading