> You'd want to update your mask appropriately to get everything you
> want to select, one criteria at a time e.g.:
> mask = a[:,0] == 1
> mask &= a[:,1] == 1960
> 
> Alternatively:
> mask = (a[:,0] == 1) & (a[:,1] == 1960)
> but be careful with the parens, & and | are normally high-priority
> bitwise operators and if you leave the parens out, it will try to
> bitwise-and 1 and a[:,1] and throw an error.
> 
> If you've got a ton of parameters, you can combine these more
> aesthetically with:
> mask = (a[:,[0,1]] == [1, 1960]).all(axis=1)
> 
> ~Brett

Zach and Brett,

Many thanks -- that is exactly what I need.

Cheers,
Ted
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to