Mapping into two lists

Alexandre Courbot alexandrecourbot at linuxgames.com
Mon Sep 3 07:57:23 EDT 2001


Sorry, I don't really get what you want to do exactly, but I think that
similar issues are discussed on Skip Montanaro great 'Python Performance
Tips' page. In particular, it discusses the issues of looping and how to
efficiently use mapping. Maybe this will help you. The adress:
http://musi-cal.mojam.com/~skip/python/fastpython.html

See you,
Alex.

On 03 Sep 2001 11:59:06 +0200, Marcus Stojek wrote:
> Hi,
> 
> I have a sorted list of int.  To generate an input file for
> a special software I have to split this list into two. Instead of
> explaining I'll give an example:
> 
> List: [ 1, 3,4,5,6,7, 9, 11,12,13,14,15, 17]
> 
> # start and end value of continuous list segment:
> Output list1: [3,7, 11,15] 
> # single values:
> Output list2: [1,9,17] 
> 
> 
> input file:
> GROUP
> generate,3,7 #generates values from 3 to 7 step 1
> generate,11,15
> add 1,9,17
> END GROUP
> 
> 
> I do have a piece of code with a lot of ifs and whiles and
> len(list)-1 and stuff. I bet this can be done much easier with some
> sophisticated mapping.
> 
> Thanks
> Marcus
> 
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 






More information about the Python-list mailing list