-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Closed
Labels
Needs TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issue
Milestone
Description
The same as #13806, but for discuss differences with DataFrame.
pd.Series([True, False, np.nan]) | pd.Series([True, False, True])
#0 True
#1 False
#2 False
# dtype: bool
pd.Series([True, False, True]) | pd.Series([True, False, np.nan])
#0 True
#1 False
#2 True
# dtype: bool
pd.DataFrame([True, False, np.nan]) | pd.DataFrame([True, False, True])
# 0
#0 True
#1 False
#2 NaN
pd.DataFrame([True, False, True]) | pd.DataFrame([True, False, np.nan])
# 0
#0 True
#1 False
#2 NaN
There looks to be 2 points:
1. NaN comparison result
As @TomAugspurger described in #13806, the basic rule is below. Based on this, DataFrame result is incorrect.
In [40]: float('nan') or 1
Out[40]: nan
In [41]: 1 or float('nan')
Out[41]: 1
2. filling NaN result
Series fills NaN included in the result with False. DataFrame should also?
Metadata
Metadata
Assignees
Labels
Needs TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issue