We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f66749d commit 4aedae4Copy full SHA for 4aedae4
pandas/tests/indexing/test_loc.py
@@ -271,13 +271,11 @@ def test_loc_empty_slice_assignment_with_datetime(self, data):
271
# issue #50942
272
# empty slice assignment with datetime or timedelta should not raise exceptions
273
mask = [False] * len(data)
274
- try:
275
- df = DataFrame(data=data, columns=["A"])
276
- res = df.loc[mask]
277
- res = df
278
- tm.assert_frame_equal(res, df)
279
- except Exception:
280
- pytest.fail("loc empty slice assignment raised Exception unexpectedly!")
+
+ df = DataFrame(data=data, columns=["A"])
+ expected = df.copy()
+ df.loc[mask] = df
+ tm.assert_frame_equal(df, expected)
281
282
283
class TestLocBaseIndependent:
0 commit comments