Skip to content

Commit

Permalink
Fix #58427 np.bool_(False) & pd.NA gives pd.NA
Browse files Browse the repository at this point in the history
  • Loading branch information
tal-ladi committed Apr 27, 2024
1 parent a1fc8e8 commit 6ebf338
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 6ebf338

Please sign in to comment.