Re: A Faster Way...

2005-05-11 Thread Fredrik Lundh
"stasz" wrote: > > hmm, there's lots of ways, huh? you can use itertools.zip instead of > > builtin zip, or do: > > > > map(None, list1, list2) > > Not! huh? > One should try a possible solution first, > >>> l1 = range(10) > >>> l2 = range(10,20) > >>> l1 > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > >>>

Re: A Faster Way...

2005-05-11 Thread stasz
On Tue, 10 May 2005 18:11:27 -0700, gene.tani wrote: > hmm, there's lots of ways, huh? you can use itertools.zip instead of > builtin zip, or do: > > map(None, list1, list2) Not! One should try a possible solution first, >>> l1 = range(10) >>> l2 = range(10,20) >>> l1 [0, 1, 2, 3, 4, 5, 6, 7, 8

Re: A Faster Way...

2005-05-11 Thread asmir . mehic
For efficient string concatenation in python look at: http://www.skymind.com/~ocrow/python_string -- http://mail.python.org/mailman/listinfo/python-list

Re: A Faster Way...

2005-05-10 Thread gene . tani
hmm, there's lots of ways, huh? you can use itertools.zip instead of builtin zip, or do: map(None, list1, list2) , which will pad the shorter one to match the longer one. -- http://mail.python.org/mailman/listinfo/python-list

Re: A Faster Way...

2005-05-10 Thread Klaus Alexander Seistrup
[EMAIL PROTECTED] wrote: > If I simplify the problem, suppose I have 2 lists like: > > a = range(10) > b = range(20,30) > > What I would like to have, is a "union" of the 2 list in a > single tuple. In other words (Python words...): > > c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, . If the

Re: A Faster Way...

2005-05-10 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > If I simplify the problem, suppose I have 2 lists like: > > a = range(10) > b = range(20,30) > > What I would like to have, is a "union" of the 2 list in a single tuple. In > other words (Python words...): > > c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, . py> a

Re: A Faster Way...

2005-05-10 Thread Andrew Dalke
andrea.gavana wrote: > If I simplify the problem, suppose I have 2 lists like: > > a = range(10) > b = range(20,30) > > What I would like to have, is a "union" of the 2 list in a single tuple. In > other words (Python words...): > > c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, . The 'yiel

Re: A Faster Way...

2005-05-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > If I simplify the problem, suppose I have 2 lists like: > > a = range(10) > b = range(20,30) > > What I would like to have, is a "union" of the 2 list in a single tuple. In > other words (Python words...): > > c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, . > > and

Re: A Faster Way...

2005-05-10 Thread Bill Mill
On 5/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello NG, > > it is probably a beginner question, but I didn't solve it without > for-loops, and I am unable to determine if there is a faster way (probably > using some built-in function) to do this task. I have to speed up a > wxPy