File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
pandas/tests/series/indexing Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -748,6 +748,7 @@ Indexing
748
748
- Bug in :meth: `DataFrame.loc ` with inconsistent behavior of loc-set with 2 given indexes to Series (:issue: `59933 `)
749
749
- Bug in :meth: `Index.get_indexer ` and similar methods when ``NaN `` is located at or after position 128 (:issue: `58924 `)
750
750
- Bug in :meth: `MultiIndex.insert ` when a new value inserted to a datetime-like level gets cast to ``NaT `` and fails indexing (:issue: `60388 `)
751
+ - Bug in :meth: `Series.__setitem__ ` when assigning boolean series with boolean indexer will raise ``LossySetitemError `` (:issue: `57338 `)
751
752
- Bug in printing :attr: `Index.names ` and :attr: `MultiIndex.levels ` would not escape single quotes (:issue: `60190 `)
752
753
- Bug in reindexing of :class: `DataFrame ` with :class: `PeriodDtype ` columns in case of consolidated block (:issue: `60980 `, :issue: `60273 `)
753
754
Original file line number Diff line number Diff line change @@ -1838,3 +1838,13 @@ def test_setitem_empty_mask_dont_upcast_dt64():
1838
1838
ser .mask (mask , "foo" , inplace = True )
1839
1839
assert ser .dtype == dti .dtype # no-op -> dont upcast
1840
1840
tm .assert_series_equal (ser , orig )
1841
+
1842
+
1843
+ def test_setitem_bool_dtype_with_boolean_indexer ():
1844
+ # GH 57338
1845
+ s1 = Series ([True , True , True ], dtype = bool )
1846
+ s2 = Series ([False , False , False ], dtype = bool )
1847
+ condition = [False , True , False ]
1848
+ s1 [condition ] = s2 [condition ]
1849
+ expected = Series ([True , False , True ], dtype = bool )
1850
+ tm .assert_series_equal (s1 , expected )
You can’t perform that action at this time.
0 commit comments