-
-
Couldn't load subscription status.
- Fork 19.2k
Open
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
ser = pd.Series([np.nan])
>>> ser.astype(bool)
0 TrueThis is correct inasmuch as bool(np.nan) is True, but I think it's a bit surprising. Analogous to how we deprecated and later disallowed .astype("int64") when NaNs are present, should we deprecate allowing this for bool?
xref #43018
Metadata
Metadata
Assignees
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action