Skip to content

Commit 899a45d

Browse files
code sample for pandas-dev#46675
1 parent bfc2265 commit 899a45d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

bisect/46675.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Index is being materialized in pd.concat when axis=1 #46675
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
s1 = pd.Series(["a", "b", "c"])
8+
s2 = pd.Series(["a", "b"])
9+
s3 = pd.Series(["a", "b", "c", "d"])
10+
s4 = pd.Series([])
11+
# <stdin>:1: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
12+
13+
sort = False
14+
join = "outer"
15+
ignore_index = False
16+
axis = 1
17+
18+
result = pd.concat(
19+
[s1, s2, s3, s4],
20+
sort=sort,
21+
join=join,
22+
ignore_index=ignore_index,
23+
axis=axis,
24+
)
25+
26+
print(result.index)
27+
28+
assert isinstance(result.index, pd.RangeIndex)

0 commit comments

Comments
 (0)