Re: [Numpy-discussion] finding elements that match any in a set

2011-05-29 Thread eat
On Sun, May 29, 2011 at 10:58 PM, Chris Barker wrote: > > On 5/28/2011 3:40 PM, Robert wrote: > >> (myarray in mylist) turns into mylist.__contains__(myarray). > >> Only the list object is ever checked for this method. There is no > >> paired method myarray.__rcontains__(mylist) so there is nothin

Re: [Numpy-discussion] finding elements that match any in a set

2011-05-29 Thread Michael Katz
Yes, in this case I definitely would have found in1d() if it was referenced in the where() section, either as a "see also" or even better as an example where where() is combined with np.in1d(): indexes_of_interest = np.where( np.in1d( my_records.integer_field, my_values_of_interest ) )

Re: [Numpy-discussion] finding elements that match any in a set

2011-05-29 Thread Chris Barker
> On 5/28/2011 3:40 PM, Robert wrote: >> (myarray in mylist) turns into mylist.__contains__(myarray). >> Only the list object is ever checked for this method. There is no >> paired method myarray.__rcontains__(mylist) so there is nothing that >> numpy can override to make this operation do anything

Re: [Numpy-discussion] AttributeError in numpy.distutils

2011-05-29 Thread Ralf Gommers
On Sun, May 22, 2011 at 8:14 PM, Branimir Sesar wrote: > On 05/22/2011 04:17 AM, Ralf Gommers wrote: > > > > > > On Thu, May 19, 2011 at 8:28 PM, Branimir Sesar > > mailto:bse...@astro.caltech.edu>> wrote: > > > > Dear Numpy users, > > > > I've encountered an AttributeError in numpy.distut

Re: [Numpy-discussion] finding elements that match any in a set

2011-05-29 Thread Neil Crighton
Michael Katz yahoo.com> writes: > Yes, thanks, np.in1d is what I needed. I didn't know how to find that. Did you check in the documentation? If so, where did you check? Would you have found it if it was in the 'See also' section of where()? (http://docs.scipy.org/doc/numpy/reference/generated/n

Re: [Numpy-discussion] finding elements that match any in a set

2011-05-29 Thread Alan G Isaac
On 5/28/2011 3:46 PM, Robert Kern wrote: > mylist.__contains__(x), it should treat all objects exactly > the same: check if it equals any item that it contains. There is no > way for it to say, "Oh, I don't know how to deal with this type, so > I'll pass it over to x.__contains__()". Which makes

Re: [Numpy-discussion] finding elements that match any in a set

2011-05-29 Thread Alan G Isaac
On 5/28/2011 3:40 PM, Robert wrote: > (myarray in mylist) turns into mylist.__contains__(myarray). > Only the list object is ever checked for this method. There is no > paired method myarray.__rcontains__(mylist) so there is nothing that > numpy can override to make this operation do anything diffe

Re: [Numpy-discussion] Contribution

2011-05-29 Thread Gael Varoquaux
On Sun, May 29, 2011 at 07:09:42AM +0400, Dmitriy Rybalkin wrote: > Thank you, Gael, I really hope that I'll improve my programming skills. > Also I have a question: Will the page with my example be deleted in > case the code is not efficient or smth else has been found to be > wrong? I cannot rea