Skip to content

Commit 76df310

Browse files
pv8473h12proost
authored andcommitted
Test added: uint64 multicolumn sort (pandas-dev#29365)
1 parent 78abe62 commit 76df310

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pandas/tests/frame/test_sorting.py

+23
Original file line numberDiff line numberDiff line change
@@ -735,3 +735,26 @@ def test_sort_index_na_position_with_categories_raises(self):
735735

736736
with pytest.raises(ValueError):
737737
df.sort_values(by="c", ascending=False, na_position="bad_position")
738+
739+
def test_sort_multicolumn_uint64(self):
740+
# GH9918
741+
# uint64 multicolumn sort
742+
743+
df = pd.DataFrame(
744+
{
745+
"a": pd.Series([18446637057563306014, 1162265347240853609]),
746+
"b": pd.Series([1, 2]),
747+
}
748+
)
749+
df["a"] = df["a"].astype(np.uint64)
750+
result = df.sort_values(["a", "b"])
751+
752+
expected = pd.DataFrame(
753+
{
754+
"a": pd.Series([18446637057563306014, 1162265347240853609]),
755+
"b": pd.Series([1, 2]),
756+
},
757+
index=pd.Index([1, 0]),
758+
)
759+
760+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)