@@ -1645,19 +1645,14 @@ def _setitem_with_indexer_split_path(self, indexer, value):
1645
1645
if isinstance (value , ABCSeries ):
1646
1646
value = self ._align_series (indexer , value )
1647
1647
1648
- info_idx = indexer [1 ]
1649
- if is_integer (info_idx ):
1650
- info_idx = [info_idx ]
1651
- labels = self .obj .columns [info_idx ]
1652
-
1653
1648
# Ensure we have something we can iterate over
1654
1649
ilocs = self ._ensure_iterable_column_indexer (indexer [1 ])
1655
1650
1656
1651
plane_indexer = indexer [:1 ]
1657
1652
lplane_indexer = length_of_indexer (plane_indexer [0 ], self .obj .index )
1658
1653
# lplane_indexer gives the expected length of obj[indexer[0]]
1659
1654
1660
- if len (labels ) == 1 :
1655
+ if len (ilocs ) == 1 :
1661
1656
# We can operate on a single column
1662
1657
1663
1658
# require that we are setting the right number of values that
@@ -1678,20 +1673,20 @@ def _setitem_with_indexer_split_path(self, indexer, value):
1678
1673
if isinstance (value , ABCDataFrame ):
1679
1674
self ._setitem_with_indexer_frame_value (indexer , value )
1680
1675
1681
- # we have an equal len ndarray/convertible to our labels
1676
+ # we have an equal len ndarray/convertible to our ilocs
1682
1677
# hasattr first, to avoid coercing to ndarray without reason.
1683
1678
# But we may be relying on the ndarray coercion to check ndim.
1684
1679
# Why not just convert to an ndarray earlier on if needed?
1685
1680
elif np .ndim (value ) == 2 :
1686
1681
self ._setitem_with_indexer_2d_value (indexer , value )
1687
1682
1688
1683
elif (
1689
- len (labels ) == 1
1684
+ len (ilocs ) == 1
1690
1685
and lplane_indexer == len (value )
1691
1686
and not is_scalar (plane_indexer [0 ])
1692
1687
):
1693
1688
# we have an equal len list/ndarray
1694
- # We only get here with len(labels) == len( ilocs) == 1
1689
+ # We only get here with len(ilocs) == 1
1695
1690
self ._setitem_single_column (ilocs [0 ], value , plane_indexer )
1696
1691
1697
1692
elif lplane_indexer == 0 and len (value ) == len (self .obj .index ):
0 commit comments