Re: [Numpy-discussion] Find contiguous sequences of booleans in arrays

2007-09-17 Thread Charles R Harris
Hi Kurdt, On 9/17/07, Kurdt Bane <[EMAIL PROTECTED]> wrote: > > Hi to all, > > I've got an 1-D array of bools and I'd like to find the length of the > first contiguous sequence of True values, starting from position [0] of the > array. > (That's equivalent to find the position of the first occurre

Re: [Numpy-discussion] Find contiguous sequences of booleans in arrays

2007-09-17 Thread stefan
Hi Kurdt, On Mon, 17 Sep 2007 12:18:51 +0200, "Kurdt Bane" <[EMAIL PROTECTED]> wrote: > I've got an 1-D array of bools and I'd like to find the length of the > first > contiguous sequence of True values, starting from position [0] of the > array. One way would be: x = N.array([True,True,False,T

Re: [Numpy-discussion] ‎ Find contiguous sequences of booleans in arrays

2007-09-17 Thread David Cournapeau
Kurdt Bane wrote: > Hi to all, > > I've got an 1-D array of bools and I'd like to find the length of the > first contiguous sequence of True values, starting from position [0] > of the array. > (That's equivalent to find the position of the first occurrence of > False in the array). One possibil

[Numpy-discussion] ‎ Find contiguous sequences of booleans in arrays

2007-09-17 Thread Kurdt Bane
Hi to all, I've got an 1-D array of bools and I'd like to find the length of the first contiguous sequence of True values, starting from position [0] of the array. (That's equivalent to find the position of the first occurrence of False in the array). The problem is trivial, but I was wondering: w