Danny Yoo wrote:
> This being said, what data are you modeling?  It almost sounds like you're
> implementing some kind of 3d matrix, even a sparse one.  More information
> about the data you're modelling might lead to a different representation
> 
> For example, would using a dictionary whose keys are three-tuples be
> approrpriate?

That is the approach Paul took originally (see the other fork of this 
thread). He is accumulating a sparse 3d matrix where the keys are year, 
field6 and month. (He hasn't said what field6 represents.) The problem 
is that he wants to print out counts corresponding to all the existing 
year and field6 values and every possible month value. To do this I 
think a two-level data structure is appropriate, such as the dict[ 
(year, field6) ][month] approach you outlined.

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to