Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread Scott W Dunning
On Mar 2, 2014, at 12:43 AM, Ben Finney wrote: > > No, that's the opposite direction :-) Inside the ‘get_guess’ function > you should use as many names as you need for the different purposes. > > So, you have one name ‘guess_number’ bound to the function's parameter. > Don't bind anything else

Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread Scott W Dunning
This is what Im having trouble with now. Here are the directions I’m stuck on and what I have so far, I’ll bold the part that’s dealing with the instructions if anyone could help me figure out where I’m going wrong. Thanks! from random import randrange randrange(1, 101) from random import s

Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread Ben Finney
Scott W Dunning writes: > This is what Im having trouble with now. Here are the directions I’m > stuck on and what I have so far, I’ll bold the part that’s dealing > with the instructions if anyone could help me figure out where I’m > going wrong. “Bold” assumes that markup of text will survive;

Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread spir
On 03/03/2014 05:03 AM, Scott W Dunning wrote: Ben Finney makes numerous fine comments already. I'll add a few, some on the same points but but expressed a bit differently (case it helps). This is what Im having trouble with now. Here are the directions I’m stuck on and what I have so far,

Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread spir
On 03/03/2014 11:27 AM, spir wrote: How would you define what these variables represent, using everyday language? My own definitions would lead me to choose the following variable names: guess_text = raw_input(promt) guess_number = int(user_guess) return guess_number sorry,

Re: [Tutor] When to use multiprocessing Managers?

2014-03-03 Thread James Chapman
Thanks for the explanation. Is there any reason or case you can think of where on a single system you would use the manager (proxied) queue over the multiprocessing (piped) queue? Actually I can probably answer this myself... The manager could potentially be extended to do some kind of data vali

Re: [Tutor] When to use multiprocessing Managers?

2014-03-03 Thread eryksun
On Mon, Mar 3, 2014 at 6:45 AM, James Chapman wrote: > Thanks for the explanation. > > Is there any reason or case you can think of where on a single system > you would use the manager (proxied) queue over the multiprocessing > (piped) queue? Not really. But a manager also lets you share lists, d

[Tutor] numerical problem

2014-03-03 Thread Gabriele Brambilla
Hi, I'm doing a sum in a for loop: www is the quantity I add. MYMAP[i, j, k] = MYMAP[i, j, k] + www MYMAP is a numpy array I have strong reasons to think that in this operation happens some numerical error...Have you suggestions to discover where it is? thanks Gabriele __

Re: [Tutor] numerical problem

2014-03-03 Thread Ben Finney
Gabriele Brambilla writes: > www is the quantity I add. > > MYMAP[i, j, k] = MYMAP[i, j, k] + www > > MYMAP is a numpy array Unfortunately, we have no idea what values are in ‘MYMAP’ nor ‘www’. So it's difficult for us to see what might be causing any problem, or even whether there is any proble

Re: [Tutor] numerical problem

2014-03-03 Thread Danny Yoo
> I'm doing a sum in a for loop: > > www is the quantity I add. > > MYMAP[i, j, k] = MYMAP[i, j, k] + www > > MYMAP is a numpy array > > I have strong reasons to think that in this operation happens some numerical > error...Have you suggestions to discover where it is? Hi Gabriele, Can you expl

Re: [Tutor] numerical problem

2014-03-03 Thread Steven D'Aprano
On Mon, Mar 03, 2014 at 08:00:52PM -0500, Gabriele Brambilla wrote: > Hi, > > I'm doing a sum in a for loop: > > www is the quantity I add. > > MYMAP[i, j, k] = MYMAP[i, j, k] + www > > MYMAP is a numpy array > > I have strong reasons to think that in this operation happens some > numerical er

Re: [Tutor] numerical problem

2014-03-03 Thread Gabriele Brambilla
ok, the things I get is very specific. my results differs from the other guy's ones with which I compare them for slightly details. We fit the data with a function and we obtain different but similar values. our fit routines on the same data return the same results. So we produce different data. t

Re: [Tutor] numerical problem

2014-03-03 Thread Gabriele Brambilla
for example I read this: On Pythons prior to 2.7 and 3.1, once you start experimenting with floating-point numbers, you're likely to stumble across something that may look a bit odd at first glance: >>> 3.1415 * 2 # repr: as code (Pythons < 2.7 and 3.1) 6.2834 >>> print(3.1415 * 2) # s

Re: [Tutor] numerical problem

2014-03-03 Thread Ben Finney
Gabriele Brambilla writes: > the values in www are like 1.01e-134 and also smaller, and I sum values > like this: there could be any problem summing so small numbers? The default floating-point number type in Python is a fixed-precision float http://docs.python.org/3/library/stdtypes.html#typesn