@@ -1067,64 +1067,6 @@ def is_numeric_v_string_like(a: ArrayLike, b) -> bool:
10671067 )
10681068
10691069
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-
11281070def needs_i8_conversion (arr_or_dtype ) -> bool :
11291071 """
11301072 Check whether the array or dtype should be converted to int64.
@@ -1790,7 +1732,6 @@ def is_all_strings(value: ArrayLike) -> bool:
17901732 "is_datetime64_dtype" ,
17911733 "is_datetime64_ns_dtype" ,
17921734 "is_datetime64tz_dtype" ,
1793- "is_datetimelike_v_numeric" ,
17941735 "is_datetime_or_timedelta_dtype" ,
17951736 "is_decimal" ,
17961737 "is_dict_like" ,
@@ -1809,7 +1750,6 @@ def is_all_strings(value: ArrayLike) -> bool:
18091750 "is_number" ,
18101751 "is_numeric_dtype" ,
18111752 "is_any_numeric_dtype" ,
1812- "is_numeric_v_string_like" ,
18131753 "is_object_dtype" ,
18141754 "is_period_dtype" ,
18151755 "is_re" ,
0 commit comments