更新时间:2021-11-27 18:02:19
分别对and
和or
尝试&
和|
或*
和+
.
Try &
and |
or *
and +
, respectively for and
and or
.
"and"和"or"比较整个对象的整体真实性,但是您需要元素级和的类似物.还有一些numpy函数logical_and
和logical_or
更明确.
"and" and "or" compares the whole truthiness of the whole object, but you want the analogue of element-wise and. There is are also numpy functions logical_and
and logical_or
to be more explicit.