Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #58427 np.bool_(False) & pd.NA gives pd.NA #58460

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions pandas/_libs/missing.pyx
Expand Up @@ -364,8 +364,14 @@ class NAType(C_NAType):
>>> pd.NA == pd.NA
<NA>

>>> True | pd.NA
>>> False | pd.NA
True

>>> False & pd.NA
False

>>> np.False_ & pd.NA
False
"""

_instance = None
Expand Down Expand Up @@ -459,7 +465,7 @@ class NAType(C_NAType):
# Logical ops using Kleene logic

def __and__(self, other):
if other is False:
if other is False or other is np.False_:
return False
elif other is True or other is C_NA:
return NA
Expand Down