[Numpy-discussion] contiguous true

2008-02-29 Thread John Hunter
[apologies if this is a resend, my mail just flaked out] I have a boolean array and would like to find the lowest index "ind" where N contiguous elements are all True. Eg, if x is In [101]: x = np.random.rand(20)>.4 In [102]: x Out[102]: array([False, True, True, False, False, True, True, F

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Robert Kern
On Fri, Feb 29, 2008 at 11:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > [apologies if this is a resend, my mail just flaked out] > > I have a boolean array and would like to find the lowest index "ind" > where N contiguous elements are all True. Eg, if x is > > In [101]: x = np.random.rand(2

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Charles R Harris
On Fri, Feb 29, 2008 at 10:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > [apologies if this is a resend, my mail just flaked out] > > I have a boolean array and would like to find the lowest index "ind" > where N contiguous elements are all True. Eg, if x is > > In [101]: x = np.random.rand(20)

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Charles R Harris
On Fri, Feb 29, 2008 at 11:12 PM, Charles R Harris < [EMAIL PROTECTED]> wrote: > > > On Fri, Feb 29, 2008 at 10:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > > > [apologies if this is a resend, my mail just flaked out] > > > > I have a boolean array and would like to find the lowest index "ind"

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Anne Archibald
On 01/03/2008, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Fri, Feb 29, 2008 at 10:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > > > I have a boolean array and would like to find the lowest index "ind" > > > where N contiguous elements are all True. Eg, if x is [...] > Oops, ind = aran