We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 721a2eb commit a8eaebfCopy full SHA for a8eaebf
pandas/core/indexes/numeric.py
@@ -477,20 +477,7 @@ def __contains__(self, other) -> bool:
477
if super().__contains__(other):
478
return True
479
480
- try:
481
- # if other is a sequence this throws a ValueError
482
- return np.isnan(other) and self.hasnans
483
- except ValueError:
484
485
- return len(other) <= 1 and other.item() in self
486
- except AttributeError:
487
- return len(other) <= 1 and other in self
488
- except TypeError:
489
- pass
490
491
492
-
493
- return False
+ return is_float(other) and np.isnan(other) and self.hasnans
494
495
@Appender(_index_shared_docs["get_loc"])
496
def get_loc(self, key, method=None, tolerance=None):
0 commit comments