On Wed, Nov 19, 2008 at 01:31, David Warde-Farley <[EMAIL PROTECTED]> wrote: > On 18-Nov-08, at 3:06 PM, Robert Kern wrote: > >> I like to discourage this use of where(). For some reason, back in >> Numeric's days, where() got stuck with two functionalities. nonzero() >> is the preferred function for this functionality. IMO, where(cond, >> if_true, if_false) should be the only use of where(). > > Hmm. nonzero() seems semantically awkward to be calling on a boolean > array, n'est pas?
Why? In Python and numpy, False==0 and True==1. -- Robert Kern "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 _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
