【发布时间】:2018-08-14 13:23:14
【问题描述】:
result=pd.Series([True,False,False]) | pd.Series([False,True,True],index=[1,2,3])
result
出来:
0 True
1 False
2 True
3 False
dtype: bool
系列如何做逻辑或?为什么结果[3] 为真?
在:
print(pd.Series([np.nan]) | pd.Series([True]))
print('----')
print(pd.Series([True]) | pd.Series([np.nan]))
出来:
0 False
dtype: bool
----------
0 True
dtype: bool
有人可以帮助解释两次逻辑或之间的区别吗?
【问题讨论】:
标签: python pandas indexing logical-operators