[Chicago] Segments in binary array

Carl Karsten carl at personnelware.com
Sat Dec 22 03:03:04 CET 2012


for L = 3, how many ranges are in:
0,0,0,0 ?

I can find 3:
1,2,3
1,2,3,4
  2,3,4

But if you are not allowed to reuse, then just the 1234 one is all there is.

but that still leaves 0,0,0,0,0,0
123 and 456 give you 2 ranges with no reuse.  Is that better than one long one?

On Fri, Dec 21, 2012 at 4:36 PM, Oren Livne <livne at uchicago.edu> wrote:
> Dear All,
>
> I have a binary numpy array A. I would like to find all ranges of
> consecutive 0's of length >= L in A. What would be an efficient
> implementation?
>
> Thanks,
> Oren
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago



-- 
Carl K


More information about the Chicago mailing list