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
> 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
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