PERF: concat along axis 1 unnecessarily materializes RangeIndex->Int64Index #47501
Closed
2 of 3 tasks
Labels
Performance
Memory or execution speed performance
Regression
Functionality that used to work in a prior pandas version
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Milestone
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this issue exists on the latest version of pandas.
I have confirmed this issue exists on the main branch of pandas.
Reproducible Example
This is as of pandas 1.4.3
Even though both inputs have identical
RangeIndex
inputs, the output index is an Int64Index. This behavior appears to be triggered by thesort=True
parameter, since removing that gives aRangeIndex
.My naive guess is that there is a missing check somewhere that the sort is a no-op on a
RangeIndex
.This issue definitely seems related to #46675, but it is not identical since it has specifically appeared in 1.4.3, whereas that issue was already present in 1.4.2.
Installed Versions
Prior Performance
This is as of pandas 1.4.2
The text was updated successfully, but these errors were encountered: