Skip to content

Commit 568d90a

Browse files
code sample for pandas-dev#47501
1 parent 899a45d commit 568d90a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bisect/47501.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PERF: concat along axis 1 unnecessarily materializes RangeIndex->Int64Index #47501
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
result = pd.concat(
8+
[pd.DataFrame({"a": range(10)}), pd.DataFrame({"b": range(10)})], sort=True, axis=1
9+
)
10+
print(result.index)
11+
12+
assert isinstance(result.index, pd.RangeIndex)

0 commit comments

Comments
 (0)