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_complex_dtype ,
94
95
is_dtype_equal ,
@@ -2205,7 +2206,7 @@ def is_boolean(self) -> bool:
2205
2206
is_numeric : Check if the Index only consists of numeric data.
2206
2207
is_object : Check if the Index is of the object dtype.
2207
2208
is_categorical : Check if the Index holds categorical data.
2208
- is_interval : Check if the Index holds Interval objects.
2209
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2209
2210
2210
2211
Examples
2211
2212
--------
@@ -2240,7 +2241,7 @@ def is_integer(self) -> bool:
2240
2241
is_numeric : Check if the Index only consists of numeric data.
2241
2242
is_object : Check if the Index is of the object dtype.
2242
2243
is_categorical : Check if the Index holds categorical data.
2243
- is_interval : Check if the Index holds Interval objects.
2244
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2244
2245
2245
2246
Examples
2246
2247
--------
@@ -2279,7 +2280,7 @@ def is_floating(self) -> bool:
2279
2280
is_numeric : Check if the Index only consists of numeric data.
2280
2281
is_object : Check if the Index is of the object dtype.
2281
2282
is_categorical : Check if the Index holds categorical data.
2282
- is_interval : Check if the Index holds Interval objects.
2283
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2283
2284
2284
2285
Examples
2285
2286
--------
@@ -2361,7 +2362,7 @@ def is_object(self) -> bool:
2361
2362
is_floating : Check if the Index is a floating type.
2362
2363
is_numeric : Check if the Index only consists of numeric data.
2363
2364
is_categorical : Check if the Index holds categorical data.
2364
- is_interval : Check if the Index holds Interval objects.
2365
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2365
2366
2366
2367
Examples
2367
2368
--------
@@ -2402,7 +2403,7 @@ def is_categorical(self) -> bool:
2402
2403
is_floating : Check if the Index is a floating type.
2403
2404
is_numeric : Check if the Index only consists of numeric data.
2404
2405
is_object : Check if the Index is of the object dtype.
2405
- is_interval : Check if the Index holds Interval objects.
2406
+ is_interval : Check if the Index holds Interval objects (deprecated) .
2406
2407
2407
2408
Examples
2408
2409
--------
@@ -2432,6 +2433,9 @@ def is_interval(self) -> bool:
2432
2433
"""
2433
2434
Check if the Index holds Interval objects.
2434
2435
2436
+ .. deprecated:: 2.0.0
2437
+ Use `pandas.api.types.is_interval_dtype` instead.
2438
+
2435
2439
Returns
2436
2440
-------
2437
2441
bool
@@ -2458,6 +2462,12 @@ def is_interval(self) -> bool:
2458
2462
>>> idx.is_interval()
2459
2463
False
2460
2464
"""
2465
+ warnings .warn (
2466
+ f"{ type (self ).__name__ } .is_interval is deprecated."
2467
+ "Use pandas.api.types.is_interval_dtype instead" ,
2468
+ FutureWarning ,
2469
+ stacklevel = find_stack_level (),
2470
+ )
2461
2471
return self .inferred_type in ["interval" ]
2462
2472
2463
2473
@final
0 commit comments