@@ -2258,7 +2258,7 @@ def is_boolean(self) -> bool:
2258
2258
is_integer : Check if the Index only consists of integers (deprecated).
2259
2259
is_floating : Check if the Index is a floating type (deprecated).
2260
2260
is_numeric : Check if the Index only consists of numeric data.
2261
- is_object : Check if the Index is of the object dtype.
2261
+ is_object : Check if the Index is of the object dtype. (deprecated)
2262
2262
is_categorical : Check if the Index holds categorical data.
2263
2263
is_interval : Check if the Index holds Interval objects (deprecated).
2264
2264
@@ -2302,7 +2302,7 @@ def is_integer(self) -> bool:
2302
2302
is_boolean : Check if the Index only consists of booleans (deprecated).
2303
2303
is_floating : Check if the Index is a floating type (deprecated).
2304
2304
is_numeric : Check if the Index only consists of numeric data.
2305
- is_object : Check if the Index is of the object dtype.
2305
+ is_object : Check if the Index is of the object dtype. (deprecated)
2306
2306
is_categorical : Check if the Index holds categorical data (deprecated).
2307
2307
is_interval : Check if the Index holds Interval objects (deprecated).
2308
2308
@@ -2350,7 +2350,7 @@ def is_floating(self) -> bool:
2350
2350
is_boolean : Check if the Index only consists of booleans (deprecated).
2351
2351
is_integer : Check if the Index only consists of integers (deprecated).
2352
2352
is_numeric : Check if the Index only consists of numeric data.
2353
- is_object : Check if the Index is of the object dtype.
2353
+ is_object : Check if the Index is of the object dtype. (deprecated)
2354
2354
is_categorical : Check if the Index holds categorical data (deprecated).
2355
2355
is_interval : Check if the Index holds Interval objects (deprecated).
2356
2356
@@ -2395,7 +2395,7 @@ def is_numeric(self) -> bool:
2395
2395
is_boolean : Check if the Index only consists of booleans (deprecated).
2396
2396
is_integer : Check if the Index only consists of integers (deprecated).
2397
2397
is_floating : Check if the Index is a floating type (deprecated).
2398
- is_object : Check if the Index is of the object dtype.
2398
+ is_object : Check if the Index is of the object dtype. (deprecated)
2399
2399
is_categorical : Check if the Index holds categorical data (deprecated).
2400
2400
is_interval : Check if the Index holds Interval objects (deprecated).
2401
2401
@@ -2427,6 +2427,8 @@ def is_numeric(self) -> bool:
2427
2427
def is_object (self ) -> bool :
2428
2428
"""
2429
2429
Check if the Index is of the object dtype.
2430
+ .. deprecated:: 2.0.0
2431
+ Use `pandas.api.types.is_object_dtype` instead.
2430
2432
2431
2433
Returns
2432
2434
-------
@@ -2461,6 +2463,14 @@ def is_object(self) -> bool:
2461
2463
>>> idx.is_object()
2462
2464
False
2463
2465
"""
2466
+
2467
+ warnings .warn (
2468
+ f"{ type (self ).__name__ } .is_object is deprecated."
2469
+ "Use pandas.api.types.is_object_dtype instead" ,
2470
+ FutureWarning ,
2471
+ stacklevel = find_stack_level (),
2472
+ )
2473
+
2464
2474
return is_object_dtype (self .dtype )
2465
2475
2466
2476
@final
@@ -2483,7 +2493,7 @@ def is_categorical(self) -> bool:
2483
2493
is_integer : Check if the Index only consists of integers (deprecated).
2484
2494
is_floating : Check if the Index is a floating type (deprecated).
2485
2495
is_numeric : Check if the Index only consists of numeric data.
2486
- is_object : Check if the Index is of the object dtype.
2496
+ is_object : Check if the Index is of the object dtype. (deprecated)
2487
2497
is_interval : Check if the Index holds Interval objects (deprecated).
2488
2498
2489
2499
Examples
@@ -2536,7 +2546,7 @@ def is_interval(self) -> bool:
2536
2546
is_integer : Check if the Index only consists of integers (deprecated).
2537
2547
is_floating : Check if the Index is a floating type (deprecated).
2538
2548
is_numeric : Check if the Index only consists of numeric data.
2539
- is_object : Check if the Index is of the object dtype.
2549
+ is_object : Check if the Index is of the object dtype. (deprecated)
2540
2550
is_categorical : Check if the Index holds categorical data (deprecated).
2541
2551
2542
2552
Examples
@@ -5018,7 +5028,7 @@ def _is_memory_usage_qualified(self) -> bool:
5018
5028
"""
5019
5029
Return a boolean if we need a qualified .info display.
5020
5030
"""
5021
- return self .is_object ( )
5031
+ return is_object_dtype ( self .dtype )
5022
5032
5023
5033
def __contains__ (self , key : Any ) -> bool :
5024
5034
"""
@@ -5132,7 +5142,7 @@ def _can_hold_identifiers_and_holds_name(self, name) -> bool:
5132
5142
https://github.com/pandas-dev/pandas/issues/19764
5133
5143
"""
5134
5144
if (
5135
- self .is_object ( )
5145
+ is_object_dtype ( self .dtype )
5136
5146
or is_string_dtype (self .dtype )
5137
5147
or is_categorical_dtype (self .dtype )
5138
5148
):
0 commit comments