@@ -2250,7 +2250,7 @@ def is_integer(self) -> bool:
22502250 is_floating : Check if the Index is a floating type (deprecated).
22512251 is_numeric : Check if the Index only consists of numeric data.
22522252 is_object : Check if the Index is of the object dtype.
2253- is_categorical : Check if the Index holds categorical data.
2253+ is_categorical : Check if the Index holds categorical data (deprecated) .
22542254 is_interval : Check if the Index holds Interval objects.
22552255
22562256 Examples
@@ -2298,7 +2298,7 @@ def is_floating(self) -> bool:
22982298 is_integer : Check if the Index only consists of integers (deprecated).
22992299 is_numeric : Check if the Index only consists of numeric data.
23002300 is_object : Check if the Index is of the object dtype.
2301- is_categorical : Check if the Index holds categorical data.
2301+ is_categorical : Check if the Index holds categorical data (deprecated) .
23022302 is_interval : Check if the Index holds Interval objects.
23032303
23042304 Examples
@@ -2343,7 +2343,7 @@ def is_numeric(self) -> bool:
23432343 is_integer : Check if the Index only consists of integers (deprecated).
23442344 is_floating : Check if the Index is a floating type (deprecated).
23452345 is_object : Check if the Index is of the object dtype.
2346- is_categorical : Check if the Index holds categorical data.
2346+ is_categorical : Check if the Index holds categorical data (deprecated) .
23472347 is_interval : Check if the Index holds Interval objects.
23482348
23492349 Examples
@@ -2386,7 +2386,7 @@ def is_object(self) -> bool:
23862386 is_integer : Check if the Index only consists of integers (deprecated).
23872387 is_floating : Check if the Index is a floating type (deprecated).
23882388 is_numeric : Check if the Index only consists of numeric data.
2389- is_categorical : Check if the Index holds categorical data.
2389+ is_categorical : Check if the Index holds categorical data (deprecated) .
23902390 is_interval : Check if the Index holds Interval objects.
23912391
23922392 Examples
@@ -2415,6 +2415,9 @@ def is_categorical(self) -> bool:
24152415 """
24162416 Check if the Index holds categorical data.
24172417
2418+ .. deprecated:: 2.0.0
2419+ Use :meth:`pandas.api.types.is_categorical_dtype` instead.
2420+
24182421 Returns
24192422 -------
24202423 bool
@@ -2451,6 +2454,13 @@ def is_categorical(self) -> bool:
24512454 >>> s.index.is_categorical()
24522455 False
24532456 """
2457+ warnings .warn (
2458+ f"{ type (self ).__name__ } .is_categorical is deprecated."
2459+ "Use pandas.api.types.is_categorical_dtype instead" ,
2460+ FutureWarning ,
2461+ stacklevel = find_stack_level (),
2462+ )
2463+
24542464 return self .inferred_type in ["categorical" ]
24552465
24562466 @final
@@ -2471,7 +2481,7 @@ def is_interval(self) -> bool:
24712481 is_floating : Check if the Index is a floating type (deprecated).
24722482 is_numeric : Check if the Index only consists of numeric data.
24732483 is_object : Check if the Index is of the object dtype.
2474- is_categorical : Check if the Index holds categorical data.
2484+ is_categorical : Check if the Index holds categorical data (deprecated) .
24752485
24762486 Examples
24772487 --------
@@ -5033,7 +5043,11 @@ def _can_hold_identifiers_and_holds_name(self, name) -> bool:
50335043
50345044 https://github.com/pandas-dev/pandas/issues/19764
50355045 """
5036- if self .is_object () or is_string_dtype (self .dtype ) or self .is_categorical ():
5046+ if (
5047+ self .is_object ()
5048+ or is_string_dtype (self .dtype )
5049+ or is_categorical_dtype (self .dtype )
5050+ ):
50375051 return name in self
50385052 return False
50395053
0 commit comments