Skip to content

Commit e19e820

Browse files
committed
fixed text case for concat
1 parent d9de374 commit e19e820

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/tests/reshape/concat/test_concat.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,19 @@ def test_concat_mixed_objs_index_names(self):
335335
s2 = Series(arr, index=index, name="bar")
336336
df = DataFrame(arr.reshape(-1, 1), index=index)
337337

338-
expected = concat([s1.to_frame(), df, s2.to_frame()])
338+
expected = DataFrame(
339+
np.kron(np.where(np.identity(3) == 1, 1, np.nan), arr).T,
340+
index=index.tolist() * 3,
341+
columns=["foo", 0, "bar"],
342+
)
339343
result = concat([s1, df, s2])
340344
tm.assert_frame_equal(result, expected)
341345

342-
expected = concat([s1.to_frame(), df, s2.to_frame()], ignore_index=True)
346+
expected = DataFrame(
347+
np.kron(np.where(np.identity(3) == 1, 1, np.nan), arr).T,
348+
index=np.arange(30, dtype=np.int64),
349+
columns=["foo", 0, "bar"],
350+
)
343351
result = concat([s1, df, s2], ignore_index=True)
344352
tm.assert_frame_equal(result, expected)
345353

0 commit comments

Comments
 (0)