[Numpy-discussion] avoiding loops when downsampling arrays

Sturla Molden sturla@molden...
Tue Feb 7 11:24:49 CST 2012


>           for i in range(m):
>               for j in range(n):
>                   found[i//4,j//4] = cond(x[i,j])
>

Blah, that should be

     found[i//4,j//4] |= cond(x[i,j])


Sturla




More information about the NumPy-Discussion mailing list