[Numpy-discussion] finding longest contiguous array slices

Ben Elliston bje at air.net.au
Sat May 21 06:55:48 EDT 2011


Hi all.

I have a 3-d array of booleans (5 x 5 x 1000, say) and would like to
return a 5 x 5 of array slices containing the longest contiguous
sequence of True values along the z axis.

Any tricks that I am missing that will make this easy?

Thanks,
Ben



More information about the NumPy-Discussion mailing list