Skip to content

Commit d419ab4

Browse files
authored
PERF: #37462 (#38248)
1 parent 65f0463 commit d419ab4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/arrays/datetimelike.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,8 @@ def _cmp_method(self, other, op):
936936
return result
937937

938938
other_vals = self._unbox(other)
939-
result = op(self._ndarray, other_vals)
939+
# GH#37462 comparison on i8 values is almost 2x faster than M8/m8
940+
result = op(self._ndarray.view("i8"), other_vals.view("i8"))
940941

941942
o_mask = isna(other)
942943
if self._hasnans | np.any(o_mask):

0 commit comments

Comments
 (0)