@@ -2228,7 +2228,7 @@ def is_boolean(self) -> bool:
2228
2228
is_numeric : Check if the Index only consists of numeric data.
2229
2229
is_object : Check if the Index is of the object dtype.
2230
2230
is_categorical : Check if the Index holds categorical data.
2231
- is_interval : Check if the Index holds Interval objects.
2231
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2232
2232
2233
2233
Examples
2234
2234
--------
@@ -2272,7 +2272,7 @@ def is_integer(self) -> bool:
2272
2272
is_numeric : Check if the Index only consists of numeric data.
2273
2273
is_object : Check if the Index is of the object dtype.
2274
2274
is_categorical : Check if the Index holds categorical data (deprecated).
2275
- is_interval : Check if the Index holds Interval objects.
2275
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2276
2276
2277
2277
Examples
2278
2278
--------
@@ -2320,7 +2320,7 @@ def is_floating(self) -> bool:
2320
2320
is_numeric : Check if the Index only consists of numeric data.
2321
2321
is_object : Check if the Index is of the object dtype.
2322
2322
is_categorical : Check if the Index holds categorical data (deprecated).
2323
- is_interval : Check if the Index holds Interval objects.
2323
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2324
2324
2325
2325
Examples
2326
2326
--------
@@ -2365,7 +2365,7 @@ def is_numeric(self) -> bool:
2365
2365
is_floating : Check if the Index is a floating type (deprecated).
2366
2366
is_object : Check if the Index is of the object dtype.
2367
2367
is_categorical : Check if the Index holds categorical data (deprecated).
2368
- is_interval : Check if the Index holds Interval objects.
2368
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2369
2369
2370
2370
Examples
2371
2371
--------
@@ -2408,7 +2408,7 @@ def is_object(self) -> bool:
2408
2408
is_floating : Check if the Index is a floating type (deprecated).
2409
2409
is_numeric : Check if the Index only consists of numeric data.
2410
2410
is_categorical : Check if the Index holds categorical data (deprecated).
2411
- is_interval : Check if the Index holds Interval objects.
2411
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2412
2412
2413
2413
Examples
2414
2414
--------
@@ -2452,7 +2452,7 @@ def is_categorical(self) -> bool:
2452
2452
is_floating : Check if the Index is a floating type (deprecated).
2453
2453
is_numeric : Check if the Index only consists of numeric data.
2454
2454
is_object : Check if the Index is of the object dtype.
2455
- is_interval : Check if the Index holds Interval objects.
2455
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2456
2456
2457
2457
Examples
2458
2458
--------
@@ -2489,6 +2489,9 @@ def is_interval(self) -> bool:
2489
2489
"""
2490
2490
Check if the Index holds Interval objects.
2491
2491
2492
+ .. deprecated:: 2.0.0
2493
+ Use `pandas.api.types.is_interval_dtype` instead.
2494
+
2492
2495
Returns
2493
2496
-------
2494
2497
bool
@@ -2515,6 +2518,12 @@ def is_interval(self) -> bool:
2515
2518
>>> idx.is_interval()
2516
2519
False
2517
2520
"""
2521
+ warnings .warn (
2522
+ f"{ type (self ).__name__ } .is_interval is deprecated."
2523
+ "Use pandas.api.types.is_interval_dtype instead" ,
2524
+ FutureWarning ,
2525
+ stacklevel = find_stack_level (),
2526
+ )
2518
2527
return self .inferred_type in ["interval" ]
2519
2528
2520
2529
@final
0 commit comments