Skip to content
Closed

1d array #58347

Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2171,7 +2171,10 @@ def setitem_inplace(self, indexer, value) -> None:
# dt64/td64, which do their own validation.
value = np_can_hold_element(arr.dtype, value)

if isinstance(value, np.ndarray) and value.ndim == 1 and len(value) == 1:
# check if the dtype of the block is object
implicit_convert = arr.dtype != 'object'
if (isinstance(value, np.ndarray) and value.ndim == 1 and len(value) == 1
and implicit_convert):
# NumPy 1.25 deprecation: https://github.com/numpy/numpy/pull/10615
value = value[0, ...]

Expand Down
Loading