@@ -920,7 +920,7 @@ def test_head_tail(string_series):
920920 tm .assert_series_equal (string_series .tail (), string_series [- 5 :])
921921 tm .assert_series_equal (string_series .tail (0 ), string_series [0 :0 ])
922922
923-
923+
924924def test_uint_drop (any_int_dtype ):
925925 # see GH18311
926926 # assigning series.loc[0] = 4 changed series.dtype to int
@@ -929,13 +929,14 @@ def test_uint_drop(any_int_dtype):
929929 expected = pd .Series ([4 , 2 , 3 ], dtype = any_int_dtype )
930930 tm .assert_series_equal (series , expected )
931931
932+
932933def test_head_tail (test_data ):
933934 assert_series_equal (test_data .series .head (), test_data .series [:5 ])
934935 assert_series_equal (test_data .series .head (0 ), test_data .series [0 :0 ])
935936 assert_series_equal (test_data .series .tail (), test_data .series [- 5 :])
936937 assert_series_equal (test_data .series .tail (0 ), test_data .series [0 :0 ])
937938
938-
939+
939940def test_index_map ():
940941 # see GH20990
941942 count = 6
@@ -949,3 +950,12 @@ def test_index_map():
949950 b .index = a .index .map (lambda x : (x .year , x .month ))
950951 except ValueError :
951952 pytest .fail ("Unexpected ValueError" )
953+
954+
955+ def test_uint_drop (any_int_dtype ):
956+ # see GH18311
957+ # assigning series.loc[0] = 4 changed series.dtype to int
958+ series = pd .Series ([1 , 2 , 3 ], dtype = any_int_dtype )
959+ series .loc [0 ] = 4
960+ expected = pd .Series ([4 , 2 , 3 ], dtype = any_int_dtype )
961+ tm .assert_series_equal (series , expected )
0 commit comments