Re: [BangPypers] List Problem..

2010-07-23 Thread anuj abhishek
I am not very sure about what you are asking for.. But, if it's just a dictionary that you want from the given list then I beleive the folloeing will work.. >>> x=[['cat',30],['cat',40],['cat',10],['dog',5],['dog',7],['dog',1]] >>> x= sorted(x) >>> xdictstart=dict(zip([x[0][0],x[3][0]],[x[0][1],x[

[BangPypers] Indian language resources for Python

2010-07-23 Thread Baiju M
Hi, If you got any Indian language resources (blog/article/book) for Python, please add it to the language pages in wiki: http://wiki.python.org/moin/CategoryLanguage I usually update Malayalam page whenever I get new links: http://wiki.python.org/moin/MalayalamLanguage Regards, Baiju M _

[BangPypers] Need Python websites and blogs within India

2010-07-23 Thread Gopalakrishnan Subramani
Hi All, I am collecting information for python related websites and blogs. I am primarily looking for the sites already offer RSS 1.0/2.0 or ATOM feeds with clear separation for python related information. A generic python related info like CPython, IronPython, Jython etc shall be mentioned here

Re: [BangPypers] list problem

2010-07-23 Thread steve
On 07/23/2010 10:34 AM, Navin Kabra wrote: 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

Re: [BangPypers] python speed comparison

2010-07-23 Thread Venkatraman S
Try "extending" with python. -V- ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] python speed comparison

2010-07-23 Thread Shashwat Anand
On Fri, Jul 23, 2010 at 1:51 PM, Baishampayan Ghose wrote: > Emil, > > > Below given is solution to a puzzle( > > http://projecteuler.net/index.php?section=problems&id=14) in python and > c > > > > Python: > > > > import time > > startT=time.time() > > maxlen=0 > > longest=0 > > for i in xrange(1,

Re: [BangPypers] python speed comparison

2010-07-23 Thread Shashwat Anand
BTW the problem is known as 3n+1 problem and you can find it in ACM archives too. http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=36 ___ BangPypers mailing list BangPypers@python.org http://mail.p

Re: [BangPypers] python speed comparison

2010-07-23 Thread Baishampayan Ghose
Emil, > Below given is solution to a puzzle( > http://projecteuler.net/index.php?section=problems&id=14) in python and c > > Python: > > import time > startT=time.time() > maxlen=0 > longest=0 > for i in xrange(1,100): >  last=i >  cnt=0 >  while(last <> 1): >  cnt=cnt+1 >  if(last%2==0): >  

Re: [BangPypers] July meetup

2010-07-23 Thread Santosh Rajan
31st is better for me also, bcos i will be in bangalore then. However this is my first time and i don't know how i could be useful/helpful. Atleast I can meet you all and see how I could be useful/helpful. On Fri, Jul 23, 2010 at 1:15 PM, Suryajith Chillara wrote: > +1 > > 31st is better. > > >

[BangPypers] python speed comparison

2010-07-23 Thread Emil Chacko
Below given is solution to a puzzle( http://projecteuler.net/index.php?section=problems&id=14) in python and c Python: import time startT=time.time() maxlen=0 longest=0 for i in xrange(1,100): last=i cnt=0 while(last <> 1): cnt=cnt+1 if(last%2==0): last=last/2 else: last=3*last

Re: [BangPypers] July meetup

2010-07-23 Thread Suryajith Chillara
+1 31st is better. On 07/22/2010 06:45 PM, Abhishek Mishra wrote: 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

Re: [BangPypers] list problem

2010-07-23 Thread Baishampayan Ghose
> For worst case and dataset in problem your script beats all. > For simple but large data it's Anand's solution just slightly ahead. > > Wow. Thanks for the info, Shekhar. I am happy :) Regards, BG -- Baishampayan Ghose b.ghose at gmail.com ___ BangP

Re: [BangPypers] list problem

2010-07-23 Thread Shekhar Tiwatne
On Friday 23 July 2010 09:11 AM, Baishampayan Ghose wrote: 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 o