Skip to content

BUG: set value with iloc and list like indexer #37041

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

Closed
wants to merge 4 commits into from
Closed
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
3 changes: 3 additions & 0 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
is_object_dtype,
is_scalar,
is_sequence,
is_categorical_dtype
)
from pandas.core.dtypes.concat import concat_compat
from pandas.core.dtypes.generic import ABCDataFrame, ABCMultiIndex, ABCSeries
Expand Down Expand Up @@ -1785,6 +1786,8 @@ def _setitem_single_column(self, loc: int, value, plane_indexer):
else:
# set the item, possibly having a dtype change
ser = ser.copy()
# if is_list_like(value) and len(value) == 1 and not is_categorical_dtype(value):
# value = value[0]
ser._mgr = ser._mgr.setitem(indexer=pi, value=value)
ser._maybe_update_cacher(clear=True)

Expand Down