File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -735,3 +735,26 @@ def test_sort_index_na_position_with_categories_raises(self):
735
735
736
736
with pytest .raises (ValueError ):
737
737
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 )
You can’t perform that action at this time.
0 commit comments