[portland] Need Help With a For Loop

Rich Shepard rshepard at appl-ecosys.com
Fri Mar 21 14:17:46 CET 2008


On Thu, 20 Mar 2008, mark gross wrote:

> perhaps I'm missing something but I'm not seeing where the i variable
> is used in the loop block.

Mark,

   I went off in the wrong direction with this function from the start, and I
need to re-write it using list comprehension.

   What I need to do is cycle through different items in the tuples in a
nested fashion. That is:

   For each level-1 name in the list of tuples:
     For each level-2 name in each level-1 name:
       For each level-3 name in each level-2 name:
 	For each level-4 name in each level-3 name3:
 	  Call the appropriate plotting function based on curve shape.

   At my level of python experience this is proving to be a major challenge
that has taken my attention for well too much time. For those of you with
more experience the algorithm implementation is probably simple and obvious.

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863


More information about the Portland mailing list