@@ -1067,64 +1067,6 @@ def is_numeric_v_string_like(a: ArrayLike, b) -> bool:
1067
1067
)
1068
1068
1069
1069
1070
- # This exists to silence numpy deprecation warnings, see GH#29553
1071
- def is_datetimelike_v_numeric (a , b ) -> bool :
1072
- """
1073
- Check if we are comparing a datetime-like object to a numeric object.
1074
- By "numeric," we mean an object that is either of an int or float dtype.
1075
-
1076
- Parameters
1077
- ----------
1078
- a : array-like, scalar
1079
- The first object to check.
1080
- b : array-like, scalar
1081
- The second object to check.
1082
-
1083
- Returns
1084
- -------
1085
- boolean
1086
- Whether we return a comparing a datetime-like to a numeric object.
1087
-
1088
- Examples
1089
- --------
1090
- >>> from datetime import datetime
1091
- >>> dt = np.datetime64(datetime(2017, 1, 1))
1092
- >>>
1093
- >>> is_datetimelike_v_numeric(1, 1)
1094
- False
1095
- >>> is_datetimelike_v_numeric(dt, dt)
1096
- False
1097
- >>> is_datetimelike_v_numeric(1, dt)
1098
- True
1099
- >>> is_datetimelike_v_numeric(dt, 1) # symmetric check
1100
- True
1101
- >>> is_datetimelike_v_numeric(np.array([dt]), 1)
1102
- True
1103
- >>> is_datetimelike_v_numeric(np.array([1]), dt)
1104
- True
1105
- >>> is_datetimelike_v_numeric(np.array([dt]), np.array([1]))
1106
- True
1107
- >>> is_datetimelike_v_numeric(np.array([1]), np.array([2]))
1108
- False
1109
- >>> is_datetimelike_v_numeric(np.array([dt]), np.array([dt]))
1110
- False
1111
- """
1112
- if not hasattr (a , "dtype" ):
1113
- a = np .asarray (a )
1114
- if not hasattr (b , "dtype" ):
1115
- b = np .asarray (b )
1116
-
1117
- def is_numeric (x ):
1118
- """
1119
- Check if an object has a numeric dtype (i.e. integer or float).
1120
- """
1121
- return is_integer_dtype (x ) or is_float_dtype (x )
1122
-
1123
- return (needs_i8_conversion (a ) and is_numeric (b )) or (
1124
- needs_i8_conversion (b ) and is_numeric (a )
1125
- )
1126
-
1127
-
1128
1070
def needs_i8_conversion (arr_or_dtype ) -> bool :
1129
1071
"""
1130
1072
Check whether the array or dtype should be converted to int64.
@@ -1790,7 +1732,6 @@ def is_all_strings(value: ArrayLike) -> bool:
1790
1732
"is_datetime64_dtype" ,
1791
1733
"is_datetime64_ns_dtype" ,
1792
1734
"is_datetime64tz_dtype" ,
1793
- "is_datetimelike_v_numeric" ,
1794
1735
"is_datetime_or_timedelta_dtype" ,
1795
1736
"is_decimal" ,
1796
1737
"is_dict_like" ,
@@ -1809,7 +1750,6 @@ def is_all_strings(value: ArrayLike) -> bool:
1809
1750
"is_number" ,
1810
1751
"is_numeric_dtype" ,
1811
1752
"is_any_numeric_dtype" ,
1812
- "is_numeric_v_string_like" ,
1813
1753
"is_object_dtype" ,
1814
1754
"is_period_dtype" ,
1815
1755
"is_re" ,
0 commit comments