Re: [Numpy-discussion] u in [u+1]

2010-02-05 Thread josef . pktd
On Fri, Feb 5, 2010 at 8:48 AM, Zachary Pincus wrote: >> I'm having some trouble here.  I have a list of numpy arrays.  I >> want to >> know if an array 'u' is in the list. > > Try: > > any(numpy.all(u == l) for l in array_list) > > standard caveats about float comparisons apply; perhaps > any(num

Re: [Numpy-discussion] u in [u+1]

2010-02-05 Thread Zachary Pincus
> I'm having some trouble here. I have a list of numpy arrays. I > want to > know if an array 'u' is in the list. Try: any(numpy.all(u == l) for l in array_list) standard caveats about float comparisons apply; perhaps any(numpy.allclose(u, l) for l in array_list) is more appropriate in certa