Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76600

Re: Collaps arrays/ list of intergers

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: Collaps arrays/ list of intergers
Date 2014-08-19 19:05 +0000
Organization A noiseless patient Spider
Message-ID <lt075d$tmv$2@dont-email.me> (permalink)
References <fb9b097d-1a25-4f28-9b3f-61636e013a91@googlegroups.com>

Show all headers | View raw


On Tue, 19 Aug 2014 05:54:24 -0700, Jurgens de Bruin wrote:

> I do hope somebody can help me with the following:
> I have the followings lists which represent the upper and lower value of
> a range/array.
> 
> a = [1,50]
> b = [75,150]
> c = [25,42]
> d = [120,149]
> e = [35,55]

I think you're starting off with the wrong data model.

I think you should be starting with is a list of either tuples or lists, 
eg:

[(1,50),(75,150),(25,42),(120,149),(35,55)]

and looking to output another list of tuples or lists, eg:

[(1,55),(75,150)]

I have a solution, but I don't consider it particularly elegant. :(

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Collaps arrays/ list of intergers Jurgens de Bruin <debruinjj@gmail.com> - 2014-08-19 05:54 -0700
  Re: Collaps arrays/ list of intergers Peter Pearson <ppearson@nowhere.invalid> - 2014-08-19 16:22 +0000
    Re: Collaps arrays/ list of intergers Rock Neurotiko <miguelglafuente@gmail.com> - 2014-08-19 19:27 +0200
  Re: Collaps arrays/ list of intergers Peter Otten <__peter__@web.de> - 2014-08-19 19:52 +0200
  Re: Collaps arrays/ list of intergers Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-19 19:05 +0000

csiph-web