How to mask numpy structured array on multiple columns? How to mask numpy structured array on multiple columns? numpy numpy

How to mask numpy structured array on multiple columns?


You can use the & operator instead of and:

A[(A['segment'] == 42) & (A['material'] == 5)]

Note that extra parantheses are required.