9898 is_float_dtype ,
9999 is_hashable ,
100100 is_integer ,
101+ is_integer_dtype ,
101102 is_interval_dtype ,
102103 is_iterator ,
103104 is_list_like ,
@@ -2188,7 +2189,7 @@ def is_boolean(self) -> bool:
21882189
21892190 See Also
21902191 --------
2191- is_integer : Check if the Index only consists of integers.
2192+ is_integer : Check if the Index only consists of integers (deprecated) .
21922193 is_floating : Check if the Index is a floating type (deprecated).
21932194 is_numeric : Check if the Index only consists of numeric data.
21942195 is_object : Check if the Index is of the object dtype.
@@ -2216,6 +2217,9 @@ def is_integer(self) -> bool:
22162217 """
22172218 Check if the Index only consists of integers.
22182219
2220+ .. deprecated:: 2.0.0
2221+ Use `pandas.api.types.is_integer_dtype` instead.
2222+
22192223 Returns
22202224 -------
22212225 bool
@@ -2244,6 +2248,12 @@ def is_integer(self) -> bool:
22442248 >>> idx.is_integer()
22452249 False
22462250 """
2251+ warnings .warn (
2252+ f"{ type (self ).__name__ } .is_integer is deprecated."
2253+ "Use pandas.api.types.is_integer_dtype instead" ,
2254+ FutureWarning ,
2255+ stacklevel = find_stack_level (),
2256+ )
22472257 return self .inferred_type in ["integer" ]
22482258
22492259 @final
@@ -2266,7 +2276,7 @@ def is_floating(self) -> bool:
22662276 See Also
22672277 --------
22682278 is_boolean : Check if the Index only consists of booleans.
2269- is_integer : Check if the Index only consists of integers.
2279+ is_integer : Check if the Index only consists of integers (deprecated) .
22702280 is_numeric : Check if the Index only consists of numeric data.
22712281 is_object : Check if the Index is of the object dtype.
22722282 is_categorical : Check if the Index holds categorical data.
@@ -2311,7 +2321,7 @@ def is_numeric(self) -> bool:
23112321 See Also
23122322 --------
23132323 is_boolean : Check if the Index only consists of booleans.
2314- is_integer : Check if the Index only consists of integers.
2324+ is_integer : Check if the Index only consists of integers (deprecated) .
23152325 is_floating : Check if the Index is a floating type (deprecated).
23162326 is_object : Check if the Index is of the object dtype.
23172327 is_categorical : Check if the Index holds categorical data.
@@ -2354,7 +2364,7 @@ def is_object(self) -> bool:
23542364 See Also
23552365 --------
23562366 is_boolean : Check if the Index only consists of booleans.
2357- is_integer : Check if the Index only consists of integers.
2367+ is_integer : Check if the Index only consists of integers (deprecated) .
23582368 is_floating : Check if the Index is a floating type (deprecated).
23592369 is_numeric : Check if the Index only consists of numeric data.
23602370 is_categorical : Check if the Index holds categorical data.
@@ -2395,7 +2405,7 @@ def is_categorical(self) -> bool:
23952405 --------
23962406 CategoricalIndex : Index for categorical data.
23972407 is_boolean : Check if the Index only consists of booleans.
2398- is_integer : Check if the Index only consists of integers.
2408+ is_integer : Check if the Index only consists of integers (deprecated) .
23992409 is_floating : Check if the Index is a floating type (deprecated).
24002410 is_numeric : Check if the Index only consists of numeric data.
24012411 is_object : Check if the Index is of the object dtype.
@@ -2438,7 +2448,7 @@ def is_interval(self) -> bool:
24382448 --------
24392449 IntervalIndex : Index for Interval objects.
24402450 is_boolean : Check if the Index only consists of booleans.
2441- is_integer : Check if the Index only consists of integers.
2451+ is_integer : Check if the Index only consists of integers (deprecated) .
24422452 is_floating : Check if the Index is a floating type (deprecated).
24432453 is_numeric : Check if the Index only consists of numeric data.
24442454 is_object : Check if the Index is of the object dtype.
@@ -3877,7 +3887,7 @@ def is_int(v):
38773887
38783888 if kind == "getitem" :
38793889 # called from the getitem slicers, validate that we are in fact integers
3880- if self .is_integer ( ) or is_index_slice :
3890+ if is_integer_dtype ( self .dtype ) or is_index_slice :
38813891 # Note: these checks are redundant if we know is_index_slice
38823892 self ._validate_indexer ("slice" , key .start , "getitem" )
38833893 self ._validate_indexer ("slice" , key .stop , "getitem" )
0 commit comments