Skip to content

Commit 2eda0c6

Browse files
committed
BUG: update dtype check in _inplace_method
1 parent fb379d8 commit 2eda0c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/core/generic.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
is_datetime64_any_dtype,
7171
is_datetime64tz_dtype,
7272
is_dict_like,
73+
is_dtype_equal,
7374
is_extension_array_dtype,
7475
is_float,
7576
is_list_like,
@@ -11266,7 +11267,11 @@ def _inplace_method(self, other, op):
1126611267
"""
1126711268
result = op(self, other)
1126811269

11269-
if self.ndim == 1 and result._indexed_same(self) and result.dtype == self.dtype:
11270+
if (
11271+
self.ndim == 1
11272+
and result._indexed_same(self)
11273+
and is_dtype_equal(result.dtype, self.dtype)
11274+
):
1127011275
# GH#36498 this inplace op can _actually_ be inplace.
1127111276
self._values[:] = result._values
1127211277
return self

0 commit comments

Comments
 (0)