Kei*_*ith 71 python boolean-logic logical-operators boolean-operations pandas
我想要元素方面的逻辑OR运算符.我知道"或"本身并不是我想要的.
我知道AND对应于&
和不对~
.但是OR怎么样?
dei*_*aur 104
相应的运营商是|
:
df[(df < 3) | (df == 5)]
Run Code Online (Sandbox Code Playgroud)
将元素检查值是否小于3或等于5.