[Numpy-discussion] Compound conditional indexing
Wed Sep 30 14:45:53 CDT 2009
On Wed, Sep 30, 2009 at 14:40, Gökhan Sever <email@example.com> wrote:
> Thanks this works.
> My second question how to access a second array using this condition?
> I am trying slice another array using a compound condition on the reference
> a = 1,2,3,4,5,
> b = 20,30,40,50,60
> I want to get elements of a only when a = 3,4. I know I need indices but how
Did you mean "elements of b only where a = 3,4"?
b[(a==3) | (a==4)]
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion