File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -542,15 +542,23 @@ def test_setitem_boolean(self):
542
542
assert_frame_equal (df , expected )
543
543
544
544
def test_setitem_boolean_ndarary (self ):
545
+ # Test for issue #18582
546
+
545
547
df = self .frame .copy ()
546
548
mask = df > np .abs (df )
547
549
expected = df .copy ()
548
550
expected .values [mask .values ] = nan
551
+
549
552
# index with 2-d boolean ndarray
550
553
actual = df .copy ()
551
554
actual [mask .values ] = nan
552
555
assert_frame_equal (actual , expected )
553
556
557
+ # index with boolean DataFrame
558
+ actual = df .copy ()
559
+ actual [mask ] = nan
560
+ assert_frame_equal (actual , expected )
561
+
554
562
def test_setitem_cast (self ):
555
563
self .frame ['D' ] = self .frame ['D' ].astype ('i8' )
556
564
assert self .frame ['D' ].dtype == np .int64
You can’t perform that action at this time.
0 commit comments