Skip to content

BUG: iloc.__setitem__ with duplicate columns #32477

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 17 commits into from
Mar 11, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
comment
  • Loading branch information
jbrockmendel committed Mar 6, 2020
commit 280418ef7aee2c76dcc1a0559db8a47d72dd79f6
6 changes: 4 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2708,8 +2708,10 @@ def _setitem_frame(self, key, value):

def _iset_item(self, loc: int, value):
self._ensure_valid_index(value)
value = self._sanitize_column(loc, value)
# FIXME: sanitize_column isnt for iloc

# passing loc to sanitize_column is a misnomer, but harmless
# with broadcast=False as long as value is never a DataFrame
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i unserstand this comment

value = self._sanitize_column(loc, value, broadcast=False)
NDFrame._iset_item(self, loc, value)

# check if we are modifying a copy
Expand Down