89
89
ensure_object ,
90
90
ensure_platform_int ,
91
91
is_bool_dtype ,
92
+ is_interval_dtype ,
92
93
is_categorical_dtype ,
93
94
is_dtype_equal ,
94
95
is_ea_or_datetimelike_dtype ,
@@ -2209,7 +2210,7 @@ def is_boolean(self) -> bool:
2209
2210
is_numeric : Check if the Index only consists of numeric data.
2210
2211
is_object : Check if the Index is of the object dtype.
2211
2212
is_categorical : Check if the Index holds categorical data.
2212
- is_interval : Check if the Index holds Interval objects.
2213
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2213
2214
2214
2215
Examples
2215
2216
--------
@@ -2253,7 +2254,7 @@ def is_integer(self) -> bool:
2253
2254
is_numeric : Check if the Index only consists of numeric data.
2254
2255
is_object : Check if the Index is of the object dtype.
2255
2256
is_categorical : Check if the Index holds categorical data (deprecated).
2256
- is_interval : Check if the Index holds Interval objects.
2257
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2257
2258
2258
2259
Examples
2259
2260
--------
@@ -2301,7 +2302,7 @@ def is_floating(self) -> bool:
2301
2302
is_numeric : Check if the Index only consists of numeric data.
2302
2303
is_object : Check if the Index is of the object dtype.
2303
2304
is_categorical : Check if the Index holds categorical data (deprecated).
2304
- is_interval : Check if the Index holds Interval objects.
2305
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2305
2306
2306
2307
Examples
2307
2308
--------
@@ -2346,7 +2347,7 @@ def is_numeric(self) -> bool:
2346
2347
is_floating : Check if the Index is a floating type (deprecated).
2347
2348
is_object : Check if the Index is of the object dtype.
2348
2349
is_categorical : Check if the Index holds categorical data (deprecated).
2349
- is_interval : Check if the Index holds Interval objects.
2350
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2350
2351
2351
2352
Examples
2352
2353
--------
@@ -2389,7 +2390,7 @@ def is_object(self) -> bool:
2389
2390
is_floating : Check if the Index is a floating type (deprecated).
2390
2391
is_numeric : Check if the Index only consists of numeric data.
2391
2392
is_categorical : Check if the Index holds categorical data (deprecated).
2392
- is_interval : Check if the Index holds Interval objects.
2393
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2393
2394
2394
2395
Examples
2395
2396
--------
@@ -2433,7 +2434,7 @@ def is_categorical(self) -> bool:
2433
2434
is_floating : Check if the Index is a floating type (deprecated).
2434
2435
is_numeric : Check if the Index only consists of numeric data.
2435
2436
is_object : Check if the Index is of the object dtype.
2436
- is_interval : Check if the Index holds Interval objects.
2437
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2437
2438
2438
2439
Examples
2439
2440
--------
@@ -2470,6 +2471,9 @@ def is_interval(self) -> bool:
2470
2471
"""
2471
2472
Check if the Index holds Interval objects.
2472
2473
2474
+ .. deprecated:: 2.0.0
2475
+ Use `pandas.api.types.is_interval_dtype` instead.
2476
+
2473
2477
Returns
2474
2478
-------
2475
2479
bool
@@ -2496,6 +2500,12 @@ def is_interval(self) -> bool:
2496
2500
>>> idx.is_interval()
2497
2501
False
2498
2502
"""
2503
+ warnings .warn (
2504
+ f"{ type (self ).__name__ } .is_interval is deprecated."
2505
+ "Use pandas.api.types.is_interval_dtype instead" ,
2506
+ FutureWarning ,
2507
+ stacklevel = find_stack_level (),
2508
+ )
2499
2509
return self .inferred_type in ["interval" ]
2500
2510
2501
2511
@final
0 commit comments