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.
You can use the &
operator instead of and
:
A[(A['segment'] == 42) & (A['material'] == 5)]
Note that extra parantheses are required.