Skip to content

Commit 458e0ce

Browse files
update condition
1 parent 59eee73 commit 458e0ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/arrays/datetimelike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ def _addsub_object_array(self, other: np.ndarray, op):
13341334
result : same class as self
13351335
"""
13361336
assert op in [operator.add, operator.sub]
1337-
if len(other) == 1:
1337+
if len(other) == 1 and (self.ndim == 1 or other.shape == self.shape == (1, 1)):
13381338
# If both 1D then broadcasting is unambiguous
13391339
# TODO(EA2D): require self.ndim == other.ndim here
13401340
return op(self, other[0])

0 commit comments

Comments
 (0)