On Donnerstag 20 Dezember 2007, Christopher Barker wrote:
In [9]: print where( (logical_or(a<1, b<3)), b,c) [4 2 2 1] (Think of the Zen.)
I'm not sure the Zen answers this one for us.
As you have guessed correctly, I was thinking of "explicit is better than implicit".
It's really a matter of taste, and many of us prefer infix notation for this kind of thing.
You're right, "where( ( (a<1) | (b<3) ), b,c)" *does* look better. I should have written "for completeness, I want to mention that logical or is called logical_or in numpy", and for boolean array, "|" seems to be "the correct way". Ciao, / / .o. /--/ ..o / / ANS ooo