I have 2 dataframes:
df1:
a b c
0 1 2 6
1 2 3 7
2 3 4 8
3 4 5 9
4 5 6 10
df2:
a b c
0 NaN NaN NaN
1 1.0 NaN NaN
2 2.0 2.0 NaN
3 4.0 3.0 NaN
4 6.0 6.0 11.0
When I trying to do df1 > df2, the output is:
In [150]:df1 > df2
Out[150]:
a b c
0 False False False
1 True False False
2 True True False
3 False True False
4 False False False
But what I expect is like this:
a b c
0 NaN NaN NaN
1 True NaN NaN
2 True True NaN
3 False True NaN
4 False False False
So, how should I do to compare 2 df and keep the null to null?