Skip to content

Commit dc8dcdc

Browse files
committed
add is_datetime_or_timedelta_any_dtype helper to dtypes/common
1 parent 447cef2 commit dc8dcdc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/dtypes/common.py

+4
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,10 @@ def is_datetime_or_timedelta_dtype(arr_or_dtype) -> bool:
10671067
return _is_dtype_type(arr_or_dtype, classes(np.datetime64, np.timedelta64))
10681068

10691069

1070+
def is_datetime_or_timedelta_any_dtype(arr_or_dtype):
1071+
return is_datetime64_any_dtype(arr_or_dtype) or is_timedelta64_dtype(arr_or_dtype)
1072+
1073+
10701074
# This exists to silence numpy deprecation warnings, see GH#29553
10711075
def is_numeric_v_string_like(a, b):
10721076
"""

0 commit comments

Comments
 (0)