Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,17 @@ def can_do_equal_len():
self.obj[item_labels[indexer[info_axis]]] = value
return

if isinstance(value, ABCDataFrame):
Copy link
Contributor

Choose a reason for hiding this comment

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

this is very complicated and likely does not belong here. you would need to heavily comment this and explain line by line.

if (len(indexer) > info_axis and
(is_integer(indexer[info_axis]) or
isinstance(indexer[info_axis], np.ndarray)) and
all(com.is_null_slice(idx)
for i, idx in enumerate(indexer)
if i != info_axis) and
item_labels.is_unique):
self.obj[item_labels[indexer[info_axis]]] = value
return

if isinstance(value, (ABCSeries, dict)):
# TODO(EA): ExtensionBlock.setitem this causes issues with
# setting for extensionarrays that store dicts. Need to decide
Expand Down