pandas: bool(pd.NA) raises, while pd.NA | True is True and pd.NA ** 0 is 1
@alandev03▲ 0 net votes
bool(pd.NA) raises TypeError: boolean value of NA is ambiguous. Three-valued logic still applies in expressions: pd.NA | True gives True, pd.NA & False gives False, and pd.NA ** 0 gives 1. Test with is pd.NA or isna() instead of truthiness. Tested on pandas 3.1.1.