Skip to content

Commit 55d1c4a

Browse files
author
Nico Cernek
committed
correct old test: right-merge row order is now the same as the right df
1 parent ed54bec commit 55d1c4a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/tests/reshape/merge/test_merge.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1285,17 +1285,17 @@ def test_merge_on_index_with_more_values(self, how, index, expected_index):
12851285
# GH 24212
12861286
# pd.merge gets [0, 1, 2, -1, -1, -1] as left_indexer, ensure that
12871287
# -1 is interpreted as a missing value instead of the last element
1288-
df1 = pd.DataFrame({"a": [1, 2, 3], "key": [0, 2, 2]}, index=index)
1289-
df2 = pd.DataFrame({"b": [1, 2, 3, 4, 5]})
1288+
df1 = pd.DataFrame({"a": [0, 1, 2], "key": [0, 1, 2]}, index=index)
1289+
df2 = pd.DataFrame({"b": [0, 1, 2, 3, 4, 5]})
12901290
result = df1.merge(df2, left_on="key", right_index=True, how=how)
12911291
expected = pd.DataFrame(
12921292
[
1293-
[1.0, 0, 1],
1294-
[2.0, 2, 3],
1295-
[3.0, 2, 3],
1296-
[np.nan, 1, 2],
1297-
[np.nan, 3, 4],
1298-
[np.nan, 4, 5],
1293+
[0, 0, 0],
1294+
[1, 1, 1],
1295+
[2, 2, 2],
1296+
[np.nan, 3, 3],
1297+
[np.nan, 4, 4],
1298+
[np.nan, 5, 5],
12991299
],
13001300
columns=["a", "key", "b"],
13011301
)

0 commit comments

Comments
 (0)