On Tue, 27 Feb 2007, Johannes Loehnert wrote:
> No. data is a dict containing the three main keys (eco, nat, soc). Each
> maps to a dict containing the subkeys (con, neu, pro). Each of those maps
> to a list of data. E.g. for
>> item = [('eco', 'con', 1, 2, 3), ('eco', 'con', 4,5,6), ('eco', 'neu', 7,8,9),
> ('nat', 'neu', 10,11,12)]
>> the result would be
>> data == {'eco': {'con': [(1,2,3), (4,5,6)],
> 'neu': [(7,8,9)]},
> 'nat': {'neu': [(10,11,12)]}}.
>> So with data['eco']['con'] you get back [(1,2,3), (4,5,6)].
A-ha! Now I see it. Thanks very much, Johannes.
> So you get only one data row for each category/subcategory combination? Or
> can there be multiple?
Multiple rows for each category/subcategory.
>> First, I need to average the 28 items in each of those 9 sets.
>> Second, I need to average the three average values for each of the 28
>> items within the main sets of eco, nat, and soc.
>> what do you mean by item? A float number?
Yes. The floats are avereaged by subcategory, then the subcategories are
averaged by category.
> Well, it ought to do exactly what your code did. averages['eco'] == barEco
> IIANM.
I see now how to write the code so it works. I mis-understood the first
message. Again, thank you very much.
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863