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