Skip to content

Commit b8acfc4

Browse files
authored
REF: avoid accessing private iloc methods (#38337)
1 parent 803bdd2 commit b8acfc4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/frame.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3167,7 +3167,7 @@ def _setitem_slice(self, key: slice, value):
31673167
# operates on labels and we need to operate positional for
31683168
# backwards-compat, xref GH#31469
31693169
self._check_setitem_copy()
3170-
self.iloc._setitem_with_indexer(key, value)
3170+
self.iloc[key] = value
31713171

31723172
def _setitem_array(self, key, value):
31733173
# also raises Exception if object array with NA values
@@ -3179,7 +3179,7 @@ def _setitem_array(self, key, value):
31793179
key = check_bool_indexer(self.index, key)
31803180
indexer = key.nonzero()[0]
31813181
self._check_setitem_copy()
3182-
self.iloc._setitem_with_indexer(indexer, value)
3182+
self.iloc[indexer] = value
31833183
else:
31843184
if isinstance(value, DataFrame):
31853185
if len(value.columns) != len(key):
@@ -3192,7 +3192,7 @@ def _setitem_array(self, key, value):
31923192
key, axis=1, raise_missing=False
31933193
)[1]
31943194
self._check_setitem_copy()
3195-
self.iloc._setitem_with_indexer((slice(None), indexer), value)
3195+
self.iloc[:, indexer] = value
31963196

31973197
def _setitem_frame(self, key, value):
31983198
# support boolean setting with DataFrame input, e.g.

0 commit comments

Comments
 (0)