@@ -799,54 +799,6 @@ def is_datetime_arraylike(arr):
799
799
return getattr (arr , "inferred_type" , None ) == "datetime"
800
800
801
801
802
- def is_datetimelike (arr ):
803
- """
804
- Check whether an array-like is a datetime-like array-like.
805
-
806
- Acceptable datetime-like objects are (but not limited to) datetime
807
- indices, periodic indices, and timedelta indices.
808
-
809
- Parameters
810
- ----------
811
- arr : array-like
812
- The array-like to check.
813
-
814
- Returns
815
- -------
816
- boolean
817
- Whether or not the array-like is a datetime-like array-like.
818
-
819
- Examples
820
- --------
821
- >>> is_datetimelike([1, 2, 3])
822
- False
823
- >>> is_datetimelike(pd.Index([1, 2, 3]))
824
- False
825
- >>> is_datetimelike(pd.DatetimeIndex([1, 2, 3]))
826
- True
827
- >>> is_datetimelike(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
828
- True
829
- >>> is_datetimelike(pd.PeriodIndex([], freq="A"))
830
- True
831
- >>> is_datetimelike(np.array([], dtype=np.datetime64))
832
- True
833
- >>> is_datetimelike(pd.Series([], dtype="timedelta64[ns]"))
834
- True
835
- >>>
836
- >>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
837
- >>> s = pd.Series([], dtype=dtype)
838
- >>> is_datetimelike(s)
839
- True
840
- """
841
-
842
- return (
843
- is_datetime64_dtype (arr )
844
- or is_datetime64tz_dtype (arr )
845
- or is_timedelta64_dtype (arr )
846
- or isinstance (arr , ABCPeriodIndex )
847
- )
848
-
849
-
850
802
def is_dtype_equal (source , target ):
851
803
"""
852
804
Check if two dtypes are equal.
@@ -1446,9 +1398,8 @@ def is_numeric(x):
1446
1398
"""
1447
1399
return is_integer_dtype (x ) or is_float_dtype (x )
1448
1400
1449
- is_datetimelike = needs_i8_conversion
1450
- return (is_datetimelike (a ) and is_numeric (b )) or (
1451
- is_datetimelike (b ) and is_numeric (a )
1401
+ return (needs_i8_conversion (a ) and is_numeric (b )) or (
1402
+ needs_i8_conversion (b ) and is_numeric (a )
1452
1403
)
1453
1404
1454
1405
0 commit comments