@@ -920,7 +920,7 @@ def test_head_tail(string_series):
920
920
tm .assert_series_equal (string_series .tail (), string_series [- 5 :])
921
921
tm .assert_series_equal (string_series .tail (0 ), string_series [0 :0 ])
922
922
923
-
923
+
924
924
def test_uint_drop (any_int_dtype ):
925
925
# see GH18311
926
926
# assigning series.loc[0] = 4 changed series.dtype to int
@@ -929,13 +929,14 @@ def test_uint_drop(any_int_dtype):
929
929
expected = pd .Series ([4 , 2 , 3 ], dtype = any_int_dtype )
930
930
tm .assert_series_equal (series , expected )
931
931
932
+
932
933
def test_head_tail (test_data ):
933
934
assert_series_equal (test_data .series .head (), test_data .series [:5 ])
934
935
assert_series_equal (test_data .series .head (0 ), test_data .series [0 :0 ])
935
936
assert_series_equal (test_data .series .tail (), test_data .series [- 5 :])
936
937
assert_series_equal (test_data .series .tail (0 ), test_data .series [0 :0 ])
937
938
938
-
939
+
939
940
def test_index_map ():
940
941
# see GH20990
941
942
count = 6
@@ -949,3 +950,12 @@ def test_index_map():
949
950
b .index = a .index .map (lambda x : (x .year , x .month ))
950
951
except ValueError :
951
952
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