@@ -734,14 +734,8 @@ def _maybe_mask_setitem_value(self, indexer, value):
734
734
735
735
if is_scalar_indexer (icols , self .ndim - 1 ) and ndim == 1 :
736
736
# e.g. test_loc_setitem_boolean_mask_allfalse
737
- if len (newkey ) == 0 :
738
- # FIXME: kludge for test_loc_setitem_boolean_mask_allfalse
739
- # TODO(GH#45333): may be fixed when deprecation is enforced
740
-
741
- value = value .iloc [:0 ]
742
- else :
743
- # test_loc_setitem_ndframe_values_alignment
744
- value = self .obj .iloc ._align_series (indexer , value )
737
+ # test_loc_setitem_ndframe_values_alignment
738
+ value = self .obj .iloc ._align_series (indexer , value )
745
739
indexer = (newkey , icols )
746
740
747
741
elif (
@@ -757,14 +751,8 @@ def _maybe_mask_setitem_value(self, indexer, value):
757
751
indexer = (newkey , icols )
758
752
759
753
elif ndim == 2 and value .shape [1 ] == 1 :
760
- if len (newkey ) == 0 :
761
- # FIXME: kludge for
762
- # test_loc_setitem_all_false_boolean_two_blocks
763
- # TODO(GH#45333): may be fixed when deprecation is enforced
764
- value = value .iloc [:0 ]
765
- else :
766
- # test_loc_setitem_ndframe_values_alignment
767
- value = self .obj .iloc ._align_frame (indexer , value )
754
+ # test_loc_setitem_ndframe_values_alignment
755
+ value = self .obj .iloc ._align_frame (indexer , value )
768
756
indexer = (newkey , icols )
769
757
elif com .is_bool_indexer (indexer ):
770
758
indexer = indexer .nonzero ()[0 ]
@@ -2255,7 +2243,7 @@ def ravel(i):
2255
2243
new_ix = Index ([new_ix ])
2256
2244
else :
2257
2245
new_ix = Index (new_ix )
2258
- if ser .index .equals (new_ix ) or not len ( new_ix ) :
2246
+ if ser .index .equals (new_ix ):
2259
2247
return ser ._values .copy ()
2260
2248
2261
2249
return ser .reindex (new_ix )._values
0 commit comments