We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
numfocus
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent f57bd72 commit 6f9ab14Copy full SHA for 6f9ab14
pandas/core/indexes/base.py
@@ -3890,7 +3890,12 @@ def _can_hold_identifiers_and_holds_name(self, name):
3890
https://github.com/pandas-dev/pandas/issues/19764
3891
"""
3892
if self.is_object() or self.is_categorical():
3893
- return name in self
+ try:
3894
+ # name likely not convertible to valid dtype in the index, catch and return False here
3895
+ # see https://github.com/pandas-dev/pandas/issues/24570
3896
+ return name in self
3897
+ except Exception:
3898
+ return False
3899
return False
3900
3901
def append(self, other):
0 commit comments