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


Groups > comp.lang.python > #76600

Re: Collaps arrays/ list of intergers

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: Collaps arrays/ list of intergers
Date Tue, 19 Aug 2014 19:05:17 +0000 (UTC)
Organization A noiseless patient Spider
Lines 27
Message-ID <lt075d$tmv$2@dont-email.me> (permalink)
References <fb9b097d-1a25-4f28-9b3f-61636e013a91@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Tue, 19 Aug 2014 19:05:17 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="66ffcfa4470a58bcddbdcd1913f98ab4"; logging-data="30431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LV4iw2Pgb9BfIPJpGcEq8HbX0BW5ZfxQ="
User-Agent Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2)
Cancel-Lock sha1:9BKqdJSSx8WD8/CKTfy+k5vQgoU=
Xref csiph.com comp.lang.python:76600

Show key headers only | 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