Thanks for all of your replies.
Rajanikanth
On Wed, Oct 8, 2008 at 11:59 PM, beginner <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On Oct 8, 6:36 pm, "Rajanikanth Jammalamadaka" <[EMAIL PROTECTED]>
> wrote:
>> Hi!
>>
>> Is there a functional way to do this?
>>
>> I have an array [0,1,2,3,0,1,2,2,3] and I
Hi,
On Oct 8, 6:36 pm, "Rajanikanth Jammalamadaka" <[EMAIL PROTECTED]>
wrote:
> Hi!
>
> Is there a functional way to do this?
>
> I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of
> non-decreasing values from this array (eg: In this case I want
> [0,1,2,3])
>
> Thanks,
>
> Rajanika
Rajanikanth Jammalamadaka:
> Is there a functional way to do this?
> I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of
> non-decreasing values from this array (eg: In this case I want
> [0,1,2,3])
In Python sometimes the best way to write the code isn't functional,
this is readable
Is there a functional way to do this?
I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of
non-decreasing values from this array (eg: In this case I want
[0,1,2,3])
Sounds like a use for a generator wrapper:
def monotonic(iterator):
i = iter(iterator)
prev = i.next()
Hi!
Is there a functional way to do this?
I have an array [0,1,2,3,0,1,2,2,3] and I want the first chunk of
non-decreasing values from this array (eg: In this case I want
[0,1,2,3])
Thanks,
Rajanikanth
--
http://mail.python.org/mailman/listinfo/python-list