Skip to content

Commit 69ae73a

Browse files
committed
TST: Nan must not be converted to string
Closes pandas-dev#28403
1 parent e950e00 commit 69ae73a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/indexing/test_loc.py

+9
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
from pandas.tests.indexing.common import Base
4444

4545

46+
def test_not_change_nan_loc():
47+
# GH 28403
48+
df = DataFrame({"A": [np.nan, "b"]})
49+
df["A"].loc[[0, 1]] = ["a", np.nan]
50+
expected = DataFrame({"A": [False, True]})
51+
tm.assert_frame_equal(df.isna(), expected)
52+
tm.assert_frame_equal(df.notna(), ~expected)
53+
54+
4655
class TestLoc(Base):
4756
def test_loc_getitem_int(self):
4857

0 commit comments

Comments
 (0)