Re: [Tutor] Benefit/Disadvantage to storing data as dictionary vs. in a class

2012-06-01 Thread Steven D'Aprano
Adam wrote: I'm working on a class that handles multiple rooms that generate a large amount of data. Currently my class model looks something like this (more apologies for any indentation errors): In my experience, what people consider "a large amount of data" and what the computer considers

Re: [Tutor] Benefit/Disadvantage to storing data as dictionary vs. in a class

2012-06-01 Thread Walter Prins
Hi Adam, On 1 June 2012 15:45, Adam wrote: > Is there any benefit to creating a class for each bucket (with an 'update' > method) vs. storing those variables as a dictionary with the 'Room' class as > {'var':0, 'avg': 0, 'sd':0, 'readings':[]} and having the Room class hold > the update function;

Re: [Tutor] Benefit/Disadvantage to storing data as dictionary vs. in a class

2012-06-01 Thread Adam
At least in my own case, the 'self.rooms[z][12][85]' is a means to accessing a 'bucket' array for a given room (z), during a given hour (12), at a given temperature(85). Each bucket holds, the average, variance, standard deviation and an array of previous readings (note, readings are not temper

Re: [Tutor] Benefit/Disadvantage to storing data as dictionary vs. in a class

2012-06-01 Thread James Reynolds
On Fri, Jun 1, 2012 at 9:12 AM, Adam wrote: > I'm working on a class that handles multiple rooms that generate a large > amount of data. Currently my class model looks something like this (more > apologies for any indentation errors): > Class Model: >rooms= {} >for z in range(num_of_zones

[Tutor] Benefit/Disadvantage to storing data as dictionary vs. in a class

2012-06-01 Thread Adam
I'm working on a class that handles multiple rooms that generate a large amount of data. Currently my class model looks something like this (more apologies for any indentation errors): Class Model: rooms= {} for z in range(num_of_zones): for i in range(24): tmp[i] = {