Logic operator for boolean indexing in Pandas

必须用括号,应为&运算优先级比==高
a[(a['some_column']==some_number) & (a['some_other_column']==some_other_number)]

works fine whereas

a[(a['some_column']==some_number) and (a['some_other_column']==some_other_number)]    
exists with error?

细节请看
posted @ 2018-12-05 10:49  andy_0212  阅读(112)  评论(0编辑  收藏  举报