本文由腾讯云+社区自动同步,原文地址 http://blogtest.stackoverflow.club/use-np-where/
Simply, use np.where(condition1 & condition2) will get the right answer,
but `np.where( list(condition1) and list(condition2)) won’t return the right answer.
So, please use &.
Try this python script:
a = [True, False, False]
b = [False, True, True]
print('a and b', a and b)You will get:
a anb [False, True, True]Reference: