Re: [BangPypers] list problem

2010-07-22 Thread Navin Kabra
On Thu, Jul 22, 2010 at 7:31 PM, Shashwat Anand wrote: >> Are you sure that'll work ? Is creating a dict from a sequence guaranteed >> to be executed serially withing the sequence ? > > It is nowhere mentioned in Docs IIRC but I have never seen any counter > example. Actually it is guaranteed. >F

Re: [BangPypers] list problem

2010-07-22 Thread Baishampayan Ghose
> Out of curiosity I tried benchmarking few of these solutions alongwith the > one I wrote using itertools.groupby. > My benchmarking did include large data sets and worst case. > Results are the shortest solution (by Anand) was way faster than others. > After that it was Steve's and mine and Navin

Re: [BangPypers] list problem

2010-07-22 Thread Shashwat Anand
On Thu, Jul 22, 2010 at 10:37 PM, Shekhar Tiwatne wrote: > On Thursday 22 July 2010 09:36 PM, Anand Balachandran Pillai wrote: > >> On Thu, Jul 22, 2010 at 7:00 PM, steve wrote: >> >> >> >>> Hi, >>> >>> >>> On 07/22/2010 05:02 PM, Anand Balachandran Pillai wrote: >>> >>> >>> On Thu, Jul 22,

Re: [BangPypers] list problem

2010-07-22 Thread Shekhar Tiwatne
On Thursday 22 July 2010 09:36 PM, Anand Balachandran Pillai wrote: On Thu, Jul 22, 2010 at 7:00 PM, steve wrote: Hi, On 07/22/2010 05:02 PM, Anand Balachandran Pillai wrote: On Thu, Jul 22, 2010 at 3:21 PM, Vikram wrote: Suppose you have the following list: >>>

Re: [BangPypers] list problem

2010-07-22 Thread Anand Balachandran Pillai
On Thu, Jul 22, 2010 at 7:00 PM, steve wrote: > Hi, > > > On 07/22/2010 05:02 PM, Anand Balachandran Pillai wrote: > >> On Thu, Jul 22, 2010 at 3:21 PM, Vikram wrote: >> >> Suppose you have the following list: >>> >>> >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] >>

[BangPypers] pycon hacksessions?

2010-07-22 Thread Zubin Mithra
Hey everyone, I could'nt find any info on whether or not hack sessions are going to be conducted as part of Pycon. Did I miss something(in the case that we *are *having them) or is there a reason we could'nt have them? Cheers, zm ___ BangPypers mailing

Re: [BangPypers] list problem

2010-07-22 Thread Shashwat Anand
On Thu, Jul 22, 2010 at 7:00 PM, steve wrote: > Hi, > > > On 07/22/2010 05:02 PM, Anand Balachandran Pillai wrote: > >> On Thu, Jul 22, 2010 at 3:21 PM, Vikram wrote: >> >> Suppose you have the following list: >>> >>> >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] >>

Re: [BangPypers] list problem

2010-07-22 Thread Shashwat Anand
On Thu, Jul 22, 2010 at 3:21 PM, Vikram wrote: > Suppose you have the following list: > > >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] > > My problem is that i wish to obtain the following two dictionaries: > xdictstart = {'cat':10, 'dog':1} > xdictend = {'cat':30, 'dog

Re: [BangPypers] list problem

2010-07-22 Thread Vikram
many thanks for this to naveen and others who responded. On Thu, 22 Jul 2010 15:54:14 +0530 wrote >I suggest that in such cases, avoid the temptation to do something clever. If it was difficult for you to write the code, it will be even more difficult to read and understand it. Unless there

Re: [BangPypers] list problem

2010-07-22 Thread steve
Hi, On 07/22/2010 05:02 PM, Anand Balachandran Pillai wrote: On Thu, Jul 22, 2010 at 3:21 PM, Vikram wrote: Suppose you have the following list: >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] My problem is that i wish to obtain the following two dictionaries: x

Re: [BangPypers] July meetup

2010-07-22 Thread Abhishek Mishra
Hackday this weekend, end of july sounds good. On Thu, Jul 22, 2010 at 2:21 PM, Noufal Ibrahim wrote: > Anand Balachandran Pillai writes: > > [...] > >> Can we have it on 30th or 31st then ?  Personally I prefer >> next week-end since I am a bit busy this week-end. >> >> Noufal ? > > [...] > > 3

[BangPypers] [JOB Opening] Juniper Networks

2010-07-22 Thread Santhosh Divakar
*Tools Development Engineer* *Job Location: Bangalore* * * *Job Description:* As a member of the Engineering Software Tools group at Juniper you will be part of a global team with primary responsibility for the tools infrastructure of the JUNOS software development environment. You will desig

Re: [BangPypers] nested list question

2010-07-22 Thread Anand Balachandran Pillai
On Thu, Jul 15, 2010 at 9:50 AM, Srinivas Reddy Thatiparthy < srinivas_thatipar...@akebonosoft.com> wrote: > I read from Python 2.6.3 docs that,copied from chm > > " Note that filter(function, iterable) is equivalent to [item for item in > iterable if function(item)] if function is not None an

Re: [BangPypers] list problem

2010-07-22 Thread Anand Balachandran Pillai
On Thu, Jul 22, 2010 at 3:21 PM, Vikram wrote: > Suppose you have the following list: > > >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] > > My problem is that i wish to obtain the following two dictionaries: > xdictstart = {'cat':10, 'dog':1} > xdictend = {'cat':30, 'dog

Re: [BangPypers] list problem

2010-07-22 Thread Baishampayan Ghose
> Suppose you have the following list: > x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] > > My problem is that i wish to obtain the following two dictionaries: > xdictstart = {'cat':10, 'dog':1} > xdictend = {'cat':30, 'dog':5} > > Any nice way to do the above? Thanks. Do

Re: [BangPypers] list problem

2010-07-22 Thread Emil Chacko
>>> for subLi in x: ... if(xdictstart.has_key(subLi[0])): ... if(xdictstart[subLi[0]]>subLi[1]): ...xdictstart[subLi[0]]=subLi[1] ... else: ... xdictstart[subLi[0]]=subLi[1] The opposite can be done to obtain the xdictend.This is one way.There might be some easier way's but i'm not aware

Re: [BangPypers] list problem

2010-07-22 Thread steve
On 07/22/2010 03:21 PM, Vikram wrote: Suppose you have the following list: x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] My problem is that i wish to obtain the following two dictionaries: xdictstart = {'cat':10, 'dog':1} xdictend = {'cat':30, 'dog':5} I don't get it,

Re: [BangPypers] list problem

2010-07-22 Thread Kenneth Gonsalves
On Thursday, July 22, 2010 03:21:38 pm Vikram wrote: > Suppose you have the following list: > >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] > > My problem is that i wish to obtain the following two dictionaries: > xdictstart = {'cat':10, 'dog':1} > xdictend = {'cat':30, '

Re: [BangPypers] list problem

2010-07-22 Thread Navin Kabra
I suggest that in such cases, avoid the temptation to do something clever. If it was difficult for you to write the code, it will be even more difficult to read and understand it. Unless there is a very good reason, write the simplest, most braindead code. xdictstart={} xdictend={} for item in sor

[BangPypers] list problem

2010-07-22 Thread Vikram
Suppose you have the following list: >>> x =[['cat',10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]] My problem is that i wish to obtain the following two dictionaries: xdictstart = {'cat':10, 'dog':1} xdictend = {'cat':30, 'dog':5} Any nice way to do the above? Thanks. --- Those in

Re: [BangPypers] Meeting

2010-07-22 Thread Baiju M
On Thu, Jul 22, 2010 at 2:57 PM, mujeesh.v.s wrote: > Hi, > >  Where you guys are going to meet.Can I join in this meeting Everyone is welcome to BangPypers meeting. This month's meeting date is not finalized yet. Regards, Baiju M ___ BangPypers maili

[BangPypers] Meeting

2010-07-22 Thread mujeesh.v.s
Hi, Where you guys are going to meet.Can I join in this meeting Mujeesh.v.s ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] July meetup

2010-07-22 Thread Noufal Ibrahim
Anand Balachandran Pillai writes: [...] > Can we have it on 30th or 31st then ? Personally I prefer > next week-end since I am a bit busy this week-end. > > Noufal ? [...] 31st is fine by me. Anyone else? -- ___ BangPypers mailing list BangPypers@

Re: [BangPypers] July meetup

2010-07-22 Thread Anand Balachandran Pillai
On Wed, Jul 21, 2010 at 3:35 PM, Sudheer Satyanarayana < sudhee...@sudheer.net> wrote: > > [...] >> >> Yes. Is Sunday fine. Any detractors? Clashes? >> >> >> > This Saturday and Sunday, I'm attending the Yahoo! Open Hack event - > http://openhackindia.eventbrite.com/ . > > > It would have been ni