File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -784,3 +784,32 @@ def convert_nested_indexer(indexer_type, keys):
784784 index = pd .MultiIndex .from_product (keys ))
785785
786786 tm .assert_series_equal (result , expected )
787+
788+ def test_loc_uint64 (self ):
789+ # GH20722
790+ # Test whether loc accept uint64 max value as index.
791+ s = pd .Series (
792+ [1 , 2 ],
793+ index = [
794+ np .iinfo ('uint64' ).max - 1 ,
795+ np .iinfo ('uint64' ).max
796+ ]
797+ )
798+ exp1 = pd .Series (
799+ [1 ],
800+ index = [
801+ 18446744073709551614
802+ ]
803+ )
804+ exp2 = pd .Series (
805+ [2 ],
806+ index = [
807+ 18446744073709551615
808+ ]
809+ )
810+
811+ tm .assert_series_equal (s .loc [[np .iinfo ('uint64' ).max - 1 ]], exp1 )
812+ assert 1 == s .loc [np .iinfo ('uint64' ).max - 1 ]
813+
814+ tm .assert_series_equal (s .loc [[np .iinfo ('uint64' ).max ]], exp2 )
815+ assert 2 == s .loc [np .iinfo ('uint64' ).max ]
You can’t perform that action at this time.
0 commit comments