Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pandas/tests/reshape/concat/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ def test_concat_frame_with_sort_false(self):

tm.assert_frame_equal(result, expected)

# GH 37937
df1 = DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}, index=[1, 2, 3])
df2 = DataFrame({"c": [7, 8, 9], "d": [10, 11, 12]}, index=[3, 1, 6])
result = pd.concat([df2, df1], axis=1, sort=False)
expected = DataFrame(
[
[7.0, 10.0, 3.0, 6.0],
[8.0, 11.0, 1.0, 4.0],
[9.0, 12.0, np.nan, np.nan],
[np.nan, np.nan, 2.0, 5.0],
],
index=[3, 1, 6, 2],
columns=["c", "d", "a", "b"],
)
tm.assert_frame_equal(result, expected)

def test_concat_sort_none_warning(self):
# GH#41518
df = DataFrame({1: [1, 2], "a": [3, 4]})
Expand Down