Skip to content

Commit 3a6cfca

Browse files
committed
assertion error fix added in pandas/core/indexes/base.py
1 parent 749d59d commit 3a6cfca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/core/indexes/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,6 +2425,13 @@ def is_categorical(self) -> bool:
24252425
>>> s.index.is_categorical()
24262426
False
24272427
"""
2428+
warnings.warn(
2429+
f"{type(self).__name__}.is_categorical is deprecated."
2430+
"Use pandas.api.types.is_categorical_dtype instead",
2431+
FutureWarning,
2432+
stacklevel=find_stack_level(),
2433+
)
2434+
24282435
return self.inferred_type in ["categorical"]
24292436

24302437
@final

0 commit comments

Comments
 (0)