当我执行 np.where(temp == True) 时,PyCharm 会发出警告
我的完整代码:
from numpy import where, array
a = array([[0.4682], [0.5318]])
b = array([[0.29828851, 0., 0.28676873, 0., 0., 0., 0., 0.28801431, 0., 0., 0.71283046, 0.],
[0.70171149, 0., 0.71323127, 0., 0., 0., 0., 0.71198569, 0., 0., 0.28716954, 0.]])
temp = b > 1.1*a
pos = where(temp == True)
print(pos)
如果我按照其他帖子中的建议将 temp == True 更改为 temp is True,则代码无法按预期工作。
这个警告应该如何解决?
(温度)在哪里工作。多谢 !! @若奥·维托里诺
感谢您的解释,@jedwards。它有助于。