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] Connecting to MySQLdb

2012-06-01 Thread James Reynolds
Virtualenv works just fine in windows On Jun 1, 2012 7:20 PM, "Corey Richardson" wrote: > On Fri, 1 Jun 2012 19:01:00 -0400 > Nicholas Picciano wrote: > > > Hello, > > > > I have downloaded MySQLdb 1.2.3 from: > > > > http://pypi.python.org/pypi/MySQL-python > > > > Also, I'm using Python 2.7,

Re: [Tutor] Connecting to MySQLdb

2012-06-01 Thread Corey Richardson
On Fri, 1 Jun 2012 19:01:00 -0400 Nicholas Picciano wrote: > Hello, > > I have downloaded MySQLdb 1.2.3 from: > > http://pypi.python.org/pypi/MySQL-python > > Also, I'm using Python 2.7, but I can't even get past here: > > >>> import MySQLdb > Traceback (most recent call last): > File "",

[Tutor] Connecting to MySQLdb

2012-06-01 Thread Nicholas Picciano
Hello, I have downloaded MySQLdb 1.2.3 from: http://pypi.python.org/pypi/MySQL-python Also, I'm using Python 2.7, but I can't even get past here: >>> import MySQLdb Traceback (most recent call last): File "", line 1, in ImportError: No module named MySQLdb Thanks ___

Re: [Tutor] (no subject)

2012-06-01 Thread Peter Otten
Jason Barrett wrote: > In python, why does 17/-10= -2? Shouldn't it be -1? http://docs.python.org/faq/programming.html#why-does-22-10-return-3 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.or

[Tutor] (no subject)

2012-06-01 Thread Jason Barrett
In python, why does 17/-10= -2? Shouldn't it be -1? Godsend221 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

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] iPython check if user running script is root user (Linux)

2012-06-01 Thread Prasad, Ramit
> > Since this is my first question to the list, is it appropriate to reply > > with a "thanks, that solved it" or is that considered unnecessary? > > Its not necessary but its not frowned on either. It is most useful where > numerous different options are being suggested since it indicates to > f

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

Re: [Tutor] Masked arrays & scipy.ndimage.

2012-06-01 Thread Koen De Munter
> Date: Fri, 1 Jun 2012 18:50:15 +1000 > From: st...@pearwood.info > To: tutor@python.org > Subject: Re: [Tutor] Masked arrays & scipy.ndimage. > > Koen De Munter wrote: >> Dear tutors, >> >> Given an image, I want to generate another image with the mean v

[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] = {

Re: [Tutor] Masked arrays & scipy.ndimage.

2012-06-01 Thread Steven D'Aprano
Koen De Munter wrote: Dear tutors, Given an image, I want to generate another image with the mean values of the pixels in their neighbourhood, thereby ignoring some of the neighbouring pixels (e.g. the padded boundary). I hoped I could use masked arrays for that, but apparently, this does not

[Tutor] Masked arrays & scipy.ndimage.

2012-06-01 Thread Koen De Munter
Dear tutors, Given an image, I want to generate another image with the mean values of the pixels in their neighbourhood, thereby ignoring some of the neighbouring pixels (e.g. the padded boundary). I hoped I could use masked arrays for that, but apparently, this does not work. -- def fnc(buff