Skip to content

Commit 9e11631

Browse files
arredondyeshsurya
authored andcommitted
BUG: GH35865 - int cast to str with colon setitem (pandas-dev#41077)
1 parent c2a9853 commit 9e11631

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/indexing/test_coercion.py

+9
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ def test_setitem_series_timedelta64(self, val, exp_dtype):
258258
)
259259
self._assert_setitem_series_conversion(obj, val, exp, exp_dtype)
260260

261+
def test_setitem_series_no_coercion_from_values_list(self):
262+
# GH35865 - int casted to str when internally calling np.array(ser.values)
263+
ser = pd.Series(["a", 1])
264+
ser[:] = list(ser.values)
265+
266+
expected = pd.Series(["a", 1])
267+
268+
tm.assert_series_equal(ser, expected)
269+
261270
def _assert_setitem_index_conversion(
262271
self, original_series, loc_key, expected_index, expected_dtype
263272
):

0 commit comments

Comments
 (0)