We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f633c7 commit d8bdb2eCopy full SHA for d8bdb2e
pandas/core/arrays/categorical.py
@@ -1750,11 +1750,12 @@ def __contains__(self, key) -> bool:
1750
# if key is a NaN, check if any NaN is in self.
1751
if is_valid_nat_for_dtype(key, self.categories.dtype):
1752
if key is not self.dtype.na_value and not isinstance(key, self.dtype.type):
1753
- warn(f"Membership check with {key} will return False in the future. "
1754
- f"Consider using {self.dtype.na_value} instead",
1755
- FutureWarning,
1756
- stacklevel=2,
1757
- )
+ warn(
+ f"Membership check with {key} will return False in the future. "
+ f"Consider using {self.dtype.na_value} instead",
+ FutureWarning,
+ stacklevel=2,
1758
+ )
1759
return self.isna().any()
1760
1761
return contains(self, key, container=self._codes)
0 commit comments