Re: To check if number is in range(x,y)

2020-12-14 Thread Tim Chase
On 2020-12-14 21:21, Schachner, Joseph wrote: > >>> r = range(10) > So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 In Python 3.x, r is *not* a list. It is a custom object/class. > >>> 2 in r > True > As expected. I'm not sure what your replies are suggesting here. I demonstrate

Re: To check if number is in range(x,y)

2020-12-14 Thread Dan Stromberg
On Mon, Dec 14, 2020 at 3:07 PM Dan Stromberg wrote: > > On Mon, Dec 14, 2020 at 1:23 PM Schachner, Joseph < > joseph.schach...@teledyne.com> wrote: > >> >>> r = range(10) >> So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 >> > To get a list of consecutive int's, you can use, for EG: > r =

Re: To check if number is in range(x,y)

2020-12-14 Thread Dan Stromberg
On Mon, Dec 14, 2020 at 1:23 PM Schachner, Joseph < joseph.schach...@teledyne.com> wrote: > >>> r = range(10) > So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 > To get a list of consecutive int's, you can use, for EG: r = list(range(10)) -- https://mail.python.org/mailman/listinfo/python-

Re: To check if number is in range(x,y)

2020-12-14 Thread 2QdxY4RzWzUUiLuE
On 2020-12-14 at 21:21:43 +, "Schachner, Joseph" wrote: > >>> r = range(10) > So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 In a number of ways, r behaves as if it were that list, but r is definitely not that list: >>> r = range(10) >>> type(r) >>> l = [0, 1, 2, 3,

RE: To check if number is in range(x,y)

2020-12-14 Thread Schachner, Joseph
nd you read Python 101 and when you've done that, read Python 201. I think they are very good "learn Python" books. If you're surprised that the end point is not included in range, you need to read Python 101. --- Joseph S. -----Original Message- From: Tim Chase Sent: Sat

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
On 2020-12-12, Tim Chase wrote: > > Hopefully this gives you the hints that you need to troubleshoot. > > -tkc > > > > Yes it explains a lot. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: To check if number is in range(x,y)

2020-12-12 Thread 2QdxY4RzWzUUiLuE
On 2020-12-12 at 10:51:00 -0600, Tim Chase wrote: > If you want numeric-range checks, Python provides the lovely > double-comparison syntax: > > >>> x = 5 > >>> 2 < x < 10 > True Not just numbers: >>> 'm' < 'n' < 'o' True >>> 'one' < 'one point five' < 'two' True Okay,

Re: To check if number is in range(x,y)

2020-12-12 Thread Tim Chase
On 2020-12-12 15:12, Bischoop wrote: > I need to check if input number is 1-5. Whatever I try it's not > working. Here are my aproaches to the problem: https://bpa.st/H62A > > What I'm doing wrong and how I should do it? A range is similar to a list in that it contains just the numbers listed:

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
Got it solved here: https://bpa.st/BFJA -- https://mail.python.org/mailman/listinfo/python-list

Re: To check if number is in range(x,y)

2020-12-12 Thread Oscar
In article , Bischoop wrote: > >I need to check if input number is 1-5. Whatever I try it's not working. >Here are my aproaches to the problem: https://bpa.st/H62A > >What I'm doing wrong and how I should do it? You need to learn about types. ;-) Input returns a string. That string is not in th

To check if number is in range(x,y)

2020-12-12 Thread Bischoop
I need to check if input number is 1-5. Whatever I try it's not working. Here are my aproaches to the problem: https://bpa.st/H62A What I'm doing wrong and how I should do it? -- Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
I've also convert the choice to int() but doesn't help. -- https://mail.python.org/mailman/listinfo/python-list

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
On 2020-12-12, Oscar wrote: > In article , > Bischoop wrote: >>I've also convert the choice to int() but doesn't help. > > Oh.. did not read this yet. How did you do this? In both places after > the input or during the comparison? If so, in which version? Only the > first version would work. The

Re: To check if number is in range(x,y)

2020-12-12 Thread Oscar
In article , Bischoop wrote: >I've also convert the choice to int() but doesn't help. Oh.. did not read this yet. How did you do this? In both places after the input or during the comparison? If so, in which version? Only the first version would work. The other two are just plain wrong. -- [J|O

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-25 Thread MRAB
On 2017-12-25 02:42, G Yu wrote: Ah, I get it now. I have to store the acircle.getCenter() in a point Point, and then access Point.getX() and Point.getY() separately. It was just that middle step that I was missing. Thanks so much! It's not strictly true that you _have to_ store the result

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-24 Thread G Yu
Ah, I get it now. I have to store the acircle.getCenter() in a point Point, and then access Point.getX() and Point.getY() separately. It was just that middle step that I was missing. Thanks so much! -- https://mail.python.org/mailman/listinfo/python-list

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-24 Thread MRAB
On 2017-12-24 02:31, G Yu wrote: But your code has: moving_circle.move(P_to_R/P_to_E, E_to_R/P_to_E) so won't that move the circle and change what: moving_circle.getCenter() returns? Yes, moving the circle changes the value of moving_circle.getCenter(). The problem is interpretin

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread Irv Kalb
> On Dec 23, 2017, at 11:44 AM, G Yu wrote: > > My program has two circles: one stationary circle, drawn at a random > location; and one moving circle, consistently drawn in the same place in the > graphics window. > > > > Currently, acircle.getCenter() outputs this: > > > > > I don't u

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread Gregory Ewing
G Yu wrote: The command gives , and I don't know how to determine the x-coordinate of the center from that output. Try this in an interactive session: p = circle.getCenter() help(p) This should give you a page of text showing all the attributes and methods your point object has. Somewhe

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread G Yu
> But your code has: > > moving_circle.move(P_to_R/P_to_E, E_to_R/P_to_E) > > so won't that move the circle and change what: > > moving_circle.getCenter() > > returns? Yes, moving the circle changes the value of moving_circle.getCenter(). The problem is interpreting the output. The

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread MRAB
On 2017-12-23 21:30, G Yu wrote: I did try that. The problem is that I already declared a point moving_object_center = (-555,-555), because that's the point I used as the center to draw the moving_object circle itself. So the moving_object_center.getX() will return -555 no matter what I do.

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread G Yu
I did try that. The problem is that I already declared a point moving_object_center = (-555,-555), because that's the point I used as the center to draw the moving_object circle itself. So the moving_object_center.getX() will return -555 no matter what I do. That's why I need to calculate the

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread MRAB
int decimals. So now, I want to convert the output of "acircle.getCenter()" to Cartesian (x,y) coordinates for both circles. Then I can use the two circle centers' x-coordinates in the if statement. Currently, acircle.getCenter() outputs this: I don't understand/can&

acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread G Yu
want to convert the output of "acircle.getCenter()" to Cartesian (x,y) coordinates for both circles. Then I can use the two circle centers' x-coordinates in the if statement. Currently, acircle.getCenter() outputs this: I don't understand/can't use the format that the location

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread jfong
Peter Otten at 2017/4/12 UTC+8 PM 8:13:53 wrote: > I should add that you can write > > lr = [[1], [0]] > lx = [] > for i in range(len(lr)): > > ... lx = lr[i][:] > > ... lx.append(0) > > ... lr[i].append(1) > > ... lr.append(lx) > > ... > lr > >[[1, 1], [0, 1],

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread Peter Otten
jf...@ms4.hinet.net wrote: > Peter Otten at 2017/4/12 UTC+8 PM 4:41:36 wrote: >> jf...@ms4.hinet.net wrote: >> >> Assuming both x and y are lists >> >> x[:] = y >> >> replaces the items in x with the items in y while >> >> >> x =

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread jfong
Peter Otten at 2017/4/12 UTC+8 PM 4:41:36 wrote: > jf...@ms4.hinet.net wrote: > > Assuming both x and y are lists > > x[:] = y > > replaces the items in x with the items in y while > > > x = y[:] > > makes a copy of y and binds that to the name x. In bo

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread Peter Otten
jf...@ms4.hinet.net wrote: Assuming both x and y are lists x[:] = y replaces the items in x with the items in y while x = y[:] makes a copy of y and binds that to the name x. In both cases x and y remain different lists, but in only in the second case x is rebound. This becomes relevant

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread alister
On Wed, 12 Apr 2017 01:08:07 -0700, jfong wrote: > I have a list of list and like to expand each "list element" by > appending a 1 and a 0 to it. For example, from "lr = [[1], [0]]" expand > to "lr = [[1,1], [0,1], [1,0], [0,0]]". > > The following won't work: > > Python 3.4.4 (v3.4.4:737efcadf5

What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread jfong
I have a list of list and like to expand each "list element" by appending a 1 and a 0 to it. For example, from "lr = [[1], [0]]" expand to "lr = [[1,1], [0,1], [1,0], [0,0]]". The following won't work: Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win

Raster top and lowe x,y how ca i get

2016-10-10 Thread Xristos Xristoou
How can i get left lower X,Y left top X,Y right lower X,Y and right Top X,Y from a raster image like dem(digital elevation model). I am nembie sorry if i have stupid quest -- https://mail.python.org/mailman/listinfo/python-list

Re: reshape and keep x,y,z ordering

2016-06-07 Thread Heli
Thanks Michael, This did the trick. array.flatten('F') works exactly as I need. Thanks a lot, -- https://mail.python.org/mailman/listinfo/python-list

Re: reshape and keep x,y,z ordering

2016-06-07 Thread Michael Selik
On Tue, Jun 7, 2016 at 7:31 AM Heli wrote: > Hello, > I have a question regarding reshaping numpy array. > > I either have a 1D array that I need to reshape to a 3D array or a 3D > array to reshape to a 1d numpy array. > > In both of these cases it is assumed that data f

Re: reshape and keep x,y,z ordering

2016-06-07 Thread Joel Goldstick
On Tue, Jun 7, 2016 at 7:25 AM, Heli wrote: > Hello, > > I have a question regarding reshaping numpy array. > > I either have a 1D array that I need to reshape to a 3D array or a 3D array > to reshape to a 1d numpy array. > > In both of these cases it is assumed that dat

reshape and keep x,y,z ordering

2016-06-07 Thread Heli
Hello, I have a question regarding reshaping numpy array. I either have a 1D array that I need to reshape to a 3D array or a 3D array to reshape to a 1d numpy array. In both of these cases it is assumed that data follows x,y,z ordering. and I use the following to reshape the numpy array

Re: Python(x,y) 64 bit

2016-04-27 Thread Stephen Hansen
On Wed, Apr 27, 2016, at 04:25 PM, Pierre wrote: > I did check and it looks like the Python(x,y) 64 distribution I > downloaded uses a 32 bit Python. > The question is if there is ANY Python(x,y) 64 distribution that uses the > 64 bit python version. > I looked it up online and

Re: Python(x,y) 64 bit

2016-04-27 Thread Pierre
On Wednesday, April 27, 2016 at 11:17:32 AM UTC-4, Zachary Ware wrote: > Hi Pierre, > > On Wed, Apr 27, 2016 at 6:23 AM, Pierre wrote: > > Hello, > > > > I installed Python(x,y) 64 bit version and ran it using a library that > > requires Python 64 bit. > >

Re: Python(x,y) 64 bit

2016-04-27 Thread Zachary Ware
Hi Pierre, On Wed, Apr 27, 2016 at 6:23 AM, Pierre wrote: > Hello, > > I installed Python(x,y) 64 bit version and ran it using a library that > requires Python 64 bit. > I got an error which indicated that I am using Python 32 bit. > > So, is the python used by Python(x,y)

Python(x,y) 64 bit

2016-04-27 Thread Pierre
Hello, I installed Python(x,y) 64 bit version and ran it using a library that requires Python 64 bit. I got an error which indicated that I am using Python 32 bit. So, is the python used by Python(x,y) 64 bit, using Python 64 or 32 bit? Thanks -- https://mail.python.org/mailman/listinfo

Re: [OT] x**y == y**x

2015-01-10 Thread Peter Pearson
On Fri, 09 Jan 2015 23:41:15 +0200, Marko Rauhamaa wrote: > Peter Pearson : > >> If you've never looked at the set of reals (x,y) satisfying x**y == >> y**x, it's worth a visit. > > Thanks, it was. The graph's something like this: [snip] > > Where

Re: [OT] x**y == y**x

2015-01-09 Thread Marko Rauhamaa
Peter Pearson : > If you've never looked at the set of reals (x,y) satisfying x**y == > y**x, it's worth a visit. Thanks, it was. The graph's something like this: | : * | : * | :

[OT] x**y == y**x

2015-01-09 Thread Peter Pearson
On 09 Jan 2015 11:07:51 +0200, Jussi Piitulainen wrote: [snip] > Which reminds me of a question that once made me smile, even laugh, > and still does: 2**3 is almost 3**2 but not quite - what gives? If you've never looked at the set of reals (x,y) satisfying x**y == y**x, it'

Re: Python(x,y) interferes with earlier Numpy installation

2014-02-13 Thread Martin Schöön
Den 2014-02-13 skrev beliav...@aol.com : > I fixed the problem by reinstalling Numpy. Good. Just one note since I happened to look into updating Python(x,y) at work today and stumbled on this: The Python(x,y) guys recommend that one removes other Python installations prior to installing Pytho

Re: Python(x,y) interferes with earlier Numpy installation

2014-02-13 Thread beliavsky
I fixed the problem by reinstalling Numpy. -- https://mail.python.org/mailman/listinfo/python-list

Python(x,y) interferes with earlier Numpy installation

2014-02-13 Thread beliavsky
I am running Python 2.7.5 on Windows 7 and installed Numpy, which worked. Then I installed Python(x,y) from a file Python(x,y)-2.7.5.2.exe, and now running the script from numpy import array, size, shape, min, max, sum a = array([1, 2, 3]) print shape(a) gives the error messages Traceback

Re: fastest data structure for retrieving objects identified by (x,y) tuple?

2012-10-04 Thread Steven D'Aprano
On Thu, 04 Oct 2012 18:11:28 +0200, Thomas Rachel wrote: > Am 04.10.2012 03:58 schrieb Steven D'Aprano: >> alist = [[None]*2400 for i in range(2400)] from random import randrange >> for i in range(1000): >> x = randrange(2400) >> y = randrange(2400) &g

Re: fastest data structure for retrieving objects identified by (x, y) tuple?

2012-10-04 Thread Thomas Rachel
Am 04.10.2012 03:58 schrieb Steven D'Aprano: alist = [[None]*2400 for i in range(2400)] from random import randrange for i in range(1000): x = randrange(2400) y = randrange(2400) adict[(x, y)] = "something" alist[x][y] = "something" The actual siz

Re: fastest data structure for retrieving objects identified by (x, y) tuple?

2012-10-04 Thread Steven D'Aprano
On Thu, 04 Oct 2012 08:21:13 -0400, Benjamin Jessup wrote: > On 10/4/2012 12:20 AM, python-list-requ...@python.org wrote: >> How do you know that? >> >> No offence, but if you can't even work out whether lookups in a dict or >> a list are faster, I can't imagine why you think you can intuit what >

Re: fastest data structure for retrieving objects identified by (x, y) tuple?

2012-10-04 Thread Benjamin Jessup
e. Whats wrong with the test below? # randomly select matrix coordinates to look-up from random import randrange test_coords = [] for i in range(1000): x = randrange(2400); y = randrange(2400); test_coords.append((x, y)) # build objects class Object():pass obj1 = Object(); obj2 = Object(

Re: fastest data structure for retrieving objects identified by (x, y) tuple?

2012-10-04 Thread Oscar Benjamin
): > x = randrange(2400) > y = randrange(2400) > adict[(x, y)] = "something" > alist[x][y] = "something" > > import sys > print(sys.getsizeof(adict)) > print(sys.getsizeof(alist) + sum(sys.getsizeof(L) for L in alist)) > > > The

Re: fastest data structure for retrieving objects identified by (x,y) tuple?

2012-10-03 Thread Steven D'Aprano
On Thu, 04 Oct 2012 01:58:16 +, Steven D'Aprano wrote: > adict: 24712 > alist: 23127324 [...] > So in this situation, a list of lists uses about 100 times > more memory than a dict, but look-ups are about 6% faster. Correction: about 1000 times more memory. Sorry for the typo. -- Steven -

Re: fastest data structure for retrieving objects identified by (x,y) tuple?

2012-10-03 Thread Steven D'Aprano
On Wed, 03 Oct 2012 18:30:24 -0400, Benjamin Jessup wrote: > I have a group of objects identified by unique (x,y) pairs and I want to > find out an object's "neighbors" in a matrix of size 2400 x 2400. [...] > There is either a neighbor, or a null value. I always know t

Re: fastest data structure for retrieving objects identified by (x, y) tuple?

2012-10-03 Thread Joshua Landau
On 3 October 2012 23:30, Benjamin Jessup wrote: > I have a group of objects identified by unique (x,y) pairs and I want to > find out an object's "neighbors" in a matrix of size 2400 x 2400. ># >#obj# # # ># >

fastest data structure for retrieving objects identified by (x,y) tuple?

2012-10-03 Thread Benjamin Jessup
I have a group of objects identified by unique (x,y) pairs and I want to find out an object's "neighbors" in a matrix of size 2400 x 2400. # #obj# # # # # # #obj#

python(x,y)

2011-08-11 Thread Tarmo Tapio
I'm using scitools (Pythonxy). It plots the curve of the function (Figure window) but when I try to close Figure window I get the message 'Pythonw.exe do not answer'. My operation system is windows 7. This happened when I'm using Matplotlib for ploting. If I use gnuplot for plotting closing works o

Re: is there a functional assert(x==y, 'error msg')

2010-05-07 Thread Vincent Davis
On Fri, May 7, 2010 at 8:38 PM, James Mills wrote: > On Sat, May 8, 2010 at 12:04 PM, Vincent Davis > wrote: > >> Is there a functional assert(x==y, 'error msg') ? >> I can only find the assert that is used like; >> assert x==y, 'error msg'

Re: is there a functional assert(x==y, 'error msg')

2010-05-07 Thread James Mills
On Sat, May 8, 2010 at 12:04 PM, Vincent Davis wrote: > Is there a functional assert(x==y, 'error msg') ? > I can only find the assert that is used like; > assert x==y, 'error msg' > What about: def assertfunc(expr, msg): assert expr, msg cheers James --

is there a functional assert(x==y, 'error msg')

2010-05-07 Thread Vincent Davis
Is there a functional assert(x==y, 'error msg') ? I can only find the assert that is used like; assert x==y, 'error msg' *Vincent Davis 720-301-3003 * vinc...@vincentdavis.net my blog <http://vincentdavis.net> | LinkedIn<http://www.linkedin.com/in/vincentdavi

Re: Ipython(x,y) Won't Run

2010-03-27 Thread Robert Kern
On 2010-03-27 11:21 , Larry Kizer wrote: I uninstalled my previous version of Python and installed Python(x,y) ver 2.6.2.0 in Windows XP - Install seemed to work fine but when I try to run Ipython(x,y) I get the following error: python.exe has encountered a problem and needs to close. We are

Ipython(x,y) Won't Run

2010-03-27 Thread Larry Kizer
I uninstalled my previous version of Python and installed Python(x,y) ver 2.6.2.0 in Windows XP - Install seemed to work fine but when I try to run Ipython(x,y) I get the following error: python.exe has encountered a problem and needs to close. We are sorry for the inconvenience. Any ideas

Re: [ANN] Python(x,y) 2.6.3.0 released

2009-10-22 Thread Scott David Daniels
Pierre Raybaut wrote: Hi all, I'm quite pleased (and relieved) to announce that Python(x,y) version 2.6.3.0 has been released. It is the first release based on Python 2.6 -- note that Python(x,y) version number will now follow the included Python version (Python(x,y) vX.Y.Z.N will be

[ANN] Python(x,y) 2.6.3.0 released

2009-10-18 Thread Pierre Raybaut
Hi all, I'm quite pleased (and relieved) to announce that Python(x,y) version 2.6.3.0 has been released. It is the first release based on Python 2.6 -- note that Python(x,y) version number will now follow the included Python version (Python(x,y) vX.Y.Z.N will be based on Python v

Re: Meta question: disappearing posts (was Re: calculating aself.value, self.randomnum = normalvariate(x, y))

2009-06-25 Thread Aahz
In article , Hendrik van Rooyen wrote: > >I have lately had some posts returned with a "seems to be forged" message. >Two reasons for that: >- first is if I use the smtp server from our local telco - saix - then there is > no apparent relationship between where the message comes from and > where

Fw: Meta question: disappearing posts (was Re: calculating aself.value, self.randomnum = normalvariate(x, y))

2009-06-25 Thread Hendrik van Rooyen
culating aself.value, self.randomnum = normalvariate(x, y)) > "Aahz" wrote: > > > While that's also a bug in Mailman (I have a long-standing to-do item to > > fix that), there are also plenty of posts that simply aren't showing up > > in c.l.py. As I said, I

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-24 Thread Ross Ridge
Ross Ridge wrote: >I'm not sure what MIME would have to do with it, but Piet van Oostrum's >problem is almost certainly as result of the python.org mail to news >gateway mangling the References header. The missing postings he's looking >for don't actually exist. Just go up the thread one more p

Re: Meta question: disappearing posts (was Re: calculating aself.value, self.randomnum = normalvariate(x, y))

2009-06-24 Thread Hendrik van Rooyen
"Aahz" wrote: > While that's also a bug in Mailman (I have a long-standing to-do item to > fix that), there are also plenty of posts that simply aren't showing up > in c.l.py. As I said, I'm pretty sure (based on what was happening with > c.l.py.announce) that it's some kind of weird problem wit

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-23 Thread Aahz
In article , Ross Ridge wrote: >Aahz wrote: >>Piet van Oostrum wrote: >>> I notice that I see several postings on news:comp.lang.python that are >>>replies to other postings that I don't see. >> >>As stated previously, my suspicion is that at least some is caused by a >>problem with MIME

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-22 Thread Ross Ridge
Piet van Oostrum wrote: >I notice that I see several postings on news:comp.lang.python that are >replies to other postings that I don't see. Aahz wrote: >As stated previously, my suspicion is that at least some is caused by a >problem with MIME messages and the mail->news gateway on python.org

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-21 Thread Aahz
In article , Piet van Oostrum wrote: > >I notice that I see several postings on news:comp.lang.python that are >replies to other postings that I don't see. As stated previously, my suspicion is that at least some is caused by a problem with MIME messages and the mail->news gateway on python.org

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-21 Thread greg
Dennis Lee Bieber wrote: unless one is reading from a server that interprets X-no-archive to mean "delete before reading". Can't be too careful with security. Destroy it, memorize it and then read it! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-21 Thread Steven D'Aprano
Piet van Oostrum wrote: > I notice that I see several postings on news:comp.lang.python that are > replies to other postings that I don't see. I see the same problem. I suspect it's because of over-vigorous spam filtering from Usenet providers. Some even block everything from anyone using Google

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-21 Thread Terry Reedy
Piet van Oostrum wrote: I notice that I see several postings on news:comp.lang.python that are replies to other postings that I don't see. Examples are the postings by Dennis Lee Bieber that I am replying to (but I break the thread on purpose). For example the posting with Message-ID: reference

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-21 Thread Chris Rebert
On Sun, Jun 21, 2009 at 5:25 AM, Piet van Oostrum wrote: > I notice that I see several postings on news:comp.lang.python that are > replies to other postings that I don't see. Examples are the postings by > Dennis Lee Bieber that I am replying to (but I As addressed in an earlier thread, Mr. Bieb

Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-21 Thread Piet van Oostrum
I notice that I see several postings on news:comp.lang.python that are replies to other postings that I don't see. Examples are the postings by Dennis Lee Bieber that I am replying to (but I break the thread on purpose). For example the posting with Message-ID: references: <77e831100906192220y553

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Vincent Davis
Quoting Dennis Lee Bieber limitedNormal ( 75, 20 ) computed statistics: mu = 75.5121294828 sigma = 8.16374859991 Note how computing the input sigma such that 3*sigma does not exceed boundaries results in a narrow bell curve (hmm, and for this set, no one scored 95-100) retryNo

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Vincent Davis
Quoting Steven, >Truncating with a while loop will result in something closer to this: > 000: * > 010: * > 020: ** > 030: > 040: *** > 050: * > 060: ** > 070: > 080: * > 090: ** > 100: * > > which is far less distorted." That is why I was thinking of a while l

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Steven D'Aprano
Vincent Davis wrote: >> # Clamp a normal distribution outcome I don't know who you are quoting -- you should give attribution to them. >> def clamp(input, min=0, max=100): ... >> if input < min: >> return min >> elif input > max: >> return max >> else: >> return input An easier way to do this:

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Xavier Ho
> > def __int__(self, x, y): > x = -1 >while not 0 <= x <= 100: > x = normalvariate(x, y) ># do other stuff > > That is the correct way to truncate a normal distribution. > > Thanks for the response. But why would you set the mean to -1

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Steven D'Aprano
Vincent Davis wrote: > I currently have something like this. > > class applicant(): > def __int__(self, x, y): > self.randomnum = normalvariate(x, y) > then other stuff > > x, y are only used to calculate self.randomnum and this seems to > work. But I

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Dave Angel
Vincent Davis wrote: I currently have something like this. class applicant(): def __int__(self, x, y): self.randomnum = normalvariate(x, y) then other stuff x, y are only used to calculate self.randomnum and this seems to work. But I want self.randomnum to be 0 <= random

calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Xavier Ho
; Ho, Technical Artist Contact Information Mobile: (+61) 04 3335 4748 Skype ID: SpaXe85 Email: cont...@xavierho.com Website: http://xavierho.com/ On Sat, Jun 20, 2009 at 10:54 PM, Vincent Davis wrote: > > # Clamp a normal distribution outcome > > > > impo

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Vincent Davis
> # Clamp a normal distribution outcome > > import random > > class applicant(): >     def __init__(self, x, y): >     self.randomnum = clamp(random.normalvariate(x, y), 0, 100) > > def clamp(input, min=0, max=100): >     """Clamps the input

Re: calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-20 Thread Xavier Ho
ormal distribution outcome import random class applicant(): def __init__(self, x, y): self.randomnum = clamp(random.normalvariate(x, y), 0, 100) def clamp(input, min=0, max=100): """Clamps the input between min and max. if input < min, returns min min

calculating a self.value, self.randomnum = normalvariate(x, y)

2009-06-19 Thread Vincent Davis
I currently have something like this. class applicant(): def __int__(self, x, y): self.randomnum = normalvariate(x, y) then other stuff x, y are only used to calculate self.randomnum and this seems to work. But I want self.randomnum to be 0 <= randomnum <= 100. The only way

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Esmail
Peter Pearson wrote: On Thu, 04 Jun 2009 03:29:42 -0500, Nick Craig-Wood wrote: [snip] Here is a demo with pygame... [snip] And just for completeness, here is a demo with PyGUI, written in similar style. Thanks for this too! Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Esmail
Scott David Daniels wrote: Esmail wrote: Scott David Daniels wrote: Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: Thanks Sc

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Esmail
Nick Craig-Wood wrote: Here is a demo with pygame... Thanks Nick, I'll be studying this too :-) Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Peter Pearson
On Thu, 04 Jun 2009 03:29:42 -0500, Nick Craig-Wood wrote: [snip] > Here is a demo with pygame... [snip] And just for completeness, here is a demo with PyGUI, written in similar style. (I'm a PyGUI newbie, so constructive criticism would be appreciated.) from GUI import Window, View, application

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Scott David Daniels
Esmail wrote: Scott David Daniels wrote: Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: Thanks Scott for taking the time to s

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Nick Craig-Wood
Esmail wrote: > Scott David Daniels wrote: > > Esmail wrote: > >> ... Tk seems a bit more complex .. but I really don't know much about > >> it and its interface with Python to make any sort of judgments as > >> to which option would be better. > > > > This should look pretty easy: > > Thanks

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Scott David Daniels wrote: Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: Thanks Scott for taking the time to share this code

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Scott David Daniels
Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: import Tkinter as tk class Mover(object): def __init__(self, ca

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Brian Blais
0+0.1*cos(t) y=y0+0.1*sin(t) if t==0: # first time calling h=plot(x,y,'o') else: h[0].set_data(x,y) draw() bb -- Brian Blais bbl...@bryant.edu http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

RE: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread esmail bonakdarian
t==0: # first time calling h=plot(x,y,'o') else: h[0].set_data(x,y) draw() bb -- Brian Blais bbl...@bryant.edu http://web.bryant.edu/~bblais _ Windows Live™ SkyDrive™: Get 25 GB of free onli

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
ma wrote: Try out PyChart, it's a very complete and has a great interface. I use it to generate statistics for some of our production machines: http://home.gna.org/pychart/ Thanks for the suggestion and link, I'm not familiar with this, but will check it out. If I can get matlibplot to work it

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Mensanator wrote: On Jun 3, 10:53 am, Esmail wrote: Hi all, I am trying to visualize a number of small objects moving over a 2D surface during run-time. I was wondering what would the easiest way to accomplish this using Python? Try Turtle Graphics using goto's. With pen up! :-) hehe .. ye

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Mensanator
t; Ideally I am looking for a shallow > learning curve and efficient implementation :-) > > These objects may be graphically represented as dots, or preferably > as small arrow heads/pointy triangles moving about as their x,y > coordinates change during run-time. > > Thanks,

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread ma
Try out PyChart, it's a very complete and has a great interface. I use it to generate statistics for some of our production machines: http://home.gna.org/pychart/ On Wed, Jun 3, 2009 at 1:28 PM, Esmail wrote: > Gökhan SEVER wrote: >> >> I don't know how easy to use pygame or pyOpenGL for data ani

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Gökhan SEVER wrote: I don't know how easy to use pygame or pyOpenGL for data animation comparing to Mayavi. Mayavi uses VTK as its visualization engine which is an OpenGL based library. I would like to learn more about how alternative tools might be beneficial say for example atmospheric part

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Gökhan SEVER
I don't know how easy to use pygame or pyOpenGL for data animation comparing to Mayavi. Mayavi uses VTK as its visualization engine which is an OpenGL based library. I would like to learn more about how alternative tools might be beneficial say for example atmospheric particle simulation or realis

  1   2   3   >