Skip to content

Commit 7decd54

Browse files
fixes
1 parent 0941d15 commit 7decd54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/tests/indexing/test_loc.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,10 +2870,12 @@ def test_loc_setitem_using_datetimelike_str_as_index(fill_val, exp_dtype):
28702870

28712871

28722872
def test_loc_set_int_dtype():
2873+
# GH#23326
28732874
df = pd.DataFrame([list("abc")])
2874-
df.loc[:, "col1"] = int(5)
2875+
df.loc[:, "col1"] = 5
28752876

2876-
assert str(df.dtypes["col1"]) == "int64"
2877+
expected = DataFrame({'0': ['a'], '1': ['b'], '2': ['c'], 'col1': [5]})
2878+
tm.assert_frame_equal(df, expected)
28772879

28782880

28792881
class TestLocSeries:

0 commit comments

Comments
 (0)