-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
API DesignMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysPDEP missing valuesIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprintIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint
Description
xref #38102 (comment)
for np.nan
we define bool(np.nan)
In [189]: 1 or np.nan
Out[189]: 1
In [190]: np.nan or 1
Out[190]: nan
however we don't do this for pd.NA
>>> pd.NA or 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pandas/_libs/missing.pyx", line 360, in pandas._libs.missing.NAType.__bool__
raise TypeError("boolean value of NA is ambiguous")
TypeError: boolean value of NA is ambiguous
I think this is pretty odd and not very useful.
Metadata
Metadata
Assignees
Labels
API DesignMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysPDEP missing valuesIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprintIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint