Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@
from pandas.tests.indexing.common import Base


@pytest.mark.parametrize(
"series, new_serie, expected_ser",
[
[[np.nan, np.nan, "b"], ["a", np.nan, np.nan], [False, True, True]],
[[np.nan, "b"], ["a", np.nan], [False, True]],
],
)
def test_not_change_nan_loc(series, new_serie, expected_ser):
# GH 28403
df = DataFrame({"A": series})
df["A"].loc[:] = new_serie
expected = DataFrame({"A": expected_ser})
tm.assert_frame_equal(df.isna(), expected)
tm.assert_frame_equal(df.notna(), ~expected)


class TestLoc(Base):
def test_loc_getitem_int(self):

Expand Down