Skip to content

Commit 96b7247

Browse files
committed
assertion error fixed in pandas/core/indexes/base.py
1 parent b8565a7 commit 96b7247

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/indexes/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5024,7 +5024,11 @@ def _can_hold_identifiers_and_holds_name(self, name) -> bool:
50245024
50255025
https://github.com/pandas-dev/pandas/issues/19764
50265026
"""
5027-
if self.is_object() or is_string_dtype(self.dtype) or self.is_categorical():
5027+
if (
5028+
self.is_object()
5029+
or is_string_dtype(self.dtype)
5030+
or is_categorical_dtype(self)
5031+
):
50285032
return name in self
50295033
return False
50305034

0 commit comments

Comments
 (0)