[Numpy-discussion] short circuit != ?

Alan G Isaac alan.isaac at gmail.com
Wed Oct 27 10:05:42 EDT 2010


On 10/27/2010 9:56 AM, Zachary Pincus wrote:
> the structure of the python language prevents
> meaningful short-circuiting in the case of
> np.any(a!=b)


Maybe:
any((ai != bi) for ai,bi in izip(a.flat,b.flat))
?

fwiw,
Alan Isaac



More information about the NumPy-Discussion mailing list