-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arrays
Milestone
Description
From a report on my blog, this seems buggy:
In [10]: a = pd.array([False, False], dtype="boolean")
In [11]: a
Out[11]:
<BooleanArray>
[False, False]
Length: 2, dtype: boolean
In [12]: a.any()
Out[12]: False
In [13]: a.any(skipna=False)
Out[13]: <NA>
I don't think there is a reason to return NA if there are no NAs in the array? (even with skipna=False
)
We probably need to do a check for the presence of any NA here in the else
clause:
pandas/pandas/core/arrays/boolean.py
Lines 520 to 526 in 37dc5dc
if skipna: | |
return result | |
else: | |
if result or len(self) == 0: | |
return result | |
else: | |
return self.dtype.na_value |
Metadata
Metadata
Assignees
Labels
BugNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arrays