网站首页 文章专栏 使用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: 1. numpy进阶:多条件查找 http://blog.sina.com.cn/s/blog_12c3192a50102xd5z.html