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

2010-02-05 Thread Neal Becker
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. As an example, u = np.arange(10) : u not in [u+1] --- ValueErrorTraceback (most

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 certain

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

2010-02-05 Thread josef . pktd
On Fri, Feb 5, 2010 at 8:48 AM, Zachary Pincus zachary.pin...@yale.edu 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;