Skip to content

REF: avoid accessing private iloc methods #38337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3170,7 +3170,7 @@ def _setitem_slice(self, key: slice, value):
# operates on labels and we need to operate positional for
# backwards-compat, xref GH#31469
self._check_setitem_copy()
self.iloc._setitem_with_indexer(key, value)
self.iloc[key] = value

def _setitem_array(self, key, value):
# also raises Exception if object array with NA values
Expand All @@ -3182,7 +3182,7 @@ def _setitem_array(self, key, value):
key = check_bool_indexer(self.index, key)
indexer = key.nonzero()[0]
self._check_setitem_copy()
self.iloc._setitem_with_indexer(indexer, value)
self.iloc[indexer] = value
else:
if isinstance(value, DataFrame):
if len(value.columns) != len(key):
Expand All @@ -3195,7 +3195,7 @@ def _setitem_array(self, key, value):
key, axis=1, raise_missing=False
)[1]
self._check_setitem_copy()
self.iloc._setitem_with_indexer((slice(None), indexer), value)
self.iloc[:, indexer] = value

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