Re: python 3.44 float addition bug?

2014-06-20 Thread INADA Naoki
Read this: https://docs.python.org/3.4/tutorial/floatingpoint.html On Sat, Jun 21, 2014 at 9:57 AM, FraserL wrote: > I think I found a strange bug in python 3.4.1, > > fresh install of > > https://www.python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi > > and a fresh install of > https://www.pyt

Re: python 3.44 float addition bug?

2014-06-20 Thread Chris Angelico
On Sat, Jun 21, 2014 at 10:57 AM, FraserL wrote: > #test code > z = 0.01 > p = 0.0 > for x, y in enumerate(range(1, 20)): > p += z > print(p) > #end General tip when you think you've found a bug: Cut out everything that isn't part of it. In this case, the enumerate has nothing to do with

Re: python 3.44 float addition bug?

2014-06-20 Thread Gary Herron
On 06/20/2014 06:11 PM, FraserL wrote: Ok I've seen https://docs.python.org/2/tutorial/floatingpoint.html now thanks to Yhg1s on #python I bet you get this kind of thing a lot, sorry :-/ Yes, often, but it's not a problem. :-) FraserL wrote in news:XnsA35313E634BA0fraserlonggmailcom34@21

Re: python 3.44 float addition bug?

2014-06-20 Thread Gary Herron
On 06/20/2014 05:57 PM, FraserL wrote: I think I found a strange bug in python 3.4.1, No, this is not a bug in Python. There is a limitation of floating point arithmetic in *all* languages, on *all* computers. Python 3 may be the first to let you see this limitation, but it's always bee

Re: python 3.44 float addition bug?

2014-06-20 Thread FraserL
Ok I've seen https://docs.python.org/2/tutorial/floatingpoint.html now thanks to Yhg1s on #python I bet you get this kind of thing a lot, sorry :-/ FraserL wrote in news:XnsA35313E634BA0fraserlonggmailcom34@216.196.109.145: > I think I found a strange bug in python 3.4.1, ... > > #test cod

python 3.44 float addition bug?

2014-06-20 Thread FraserL
I think I found a strange bug in python 3.4.1, fresh install of https://www.python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi and a fresh install of https://www.python.org/ftp/python/2.7.7/python-2.7.7.amd64.msi to compare it to. #test code z = 0.01 p = 0.0 for x, y in enumerate(range(1, 2

Re: PyPy3 2.3.1 released

2014-06-20 Thread Tim Delaney
Congratulations. I can't find the details of PyPy3's unicode implementation documented anywhere. Is it equivalent to: - a Python 3.2 narrow build - a Python 3.2 wide build - PEP 393 - something else? Cheers, Tim Delaney On 21 June 2014 06:32, Philip Jenvey wrote: > = >

Re: PyPy3 2.3.1 released

2014-06-20 Thread Zachary Ware
On Fri, Jun 20, 2014 at 3:32 PM, Philip Jenvey wrote: > = > PyPy3 2.3.1 - Fulcrum > = > > We're pleased to announce the first stable release of PyPy3. PyPy3 > targets Python 3 (3.2.5) compatibility. I'd just like to say: congratulations, and thank you! I'm

PyPy3 2.3.1 released

2014-06-20 Thread Philip Jenvey
= PyPy3 2.3.1 - Fulcrum = We're pleased to announce the first stable release of PyPy3. PyPy3 targets Python 3 (3.2.5) compatibility. We would like to thank all of the people who donated_ to the `py3k proposal`_ for supporting the work that went into this.

Re: Python 3.4.1 install failure on Yosimite

2014-06-20 Thread Ned Deily
In article , sam.griff...@interactivewebsystems.com wrote: > Trying to install Python 3.4.1 on OS X Yosimite, I get the following error. > > I couldn't find the place on the Python.org site to put this as an error so > I'm posting it here in the mean time. Note the process name: the crash is in

Re: how to check if a value is a floating point or not

2014-06-20 Thread Ian Kelly
On Fri, Jun 20, 2014 at 8:28 AM, Grant Edwards wrote: > On 2014-06-20, Mark Lawrence wrote: > >> For the OP a very important rule of thumb is never use a bare except, so >> this is right out. >> >> try: >> doSomething() >> except: >> WTF() > > IMO, that sort of depends on WTF() does. On

Re: how to check if a value is a floating point or not

2014-06-20 Thread alister
On Fri, 20 Jun 2014 14:28:52 +, Grant Edwards wrote: > On 2014-06-20, Mark Lawrence wrote: > >> For the OP a very important rule of thumb is never use a bare except, >> so this is right out. >> >> try: >> doSomething() >> except: >> WTF() > > IMO, that sort of depends on WTF() doe

Re: Matplotlib Colouring outline of histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 9:10:58 AM UTC+1, Jamie Mitchell wrote: > Hi folks, > > > > Instead of colouring the entire bar of a histogram i.e. filling it, I would > like to colour just the outline of the histogram. Does anyone know how to do > this? > > Version - Python2.7 > > > > Cheers, >

Re: Matplotlib Colouring outline of histogram

2014-06-20 Thread Jason Swails
On Fri, Jun 20, 2014 at 10:27 AM, Jamie Mitchell < jamiemitchell1...@gmail.com> wrote: > > That's great Jason thanks for the detailed response, I went with the > easier option 1! > > I am also trying to put hatches on my histograms like so: > > plt.hist(dataset,bins=10,hatch=['*']) > > When it com

Re: Matplotlib Colouring outline of histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 2:47:03 PM UTC+1, Jason Swails wrote: > On Fri, Jun 20, 2014 at 4:10 AM, Jamie Mitchell wrote: > > Hi folks, > > > > Instead of colouring the entire bar of a histogram i.e. filling it, I would > like to colour just the outline of the histogram. Does anyone know how to

Re: how to check if a value is a floating point or not

2014-06-20 Thread Grant Edwards
On 2014-06-20, Mark Lawrence wrote: > For the OP a very important rule of thumb is never use a bare except, so > this is right out. > > try: > doSomething() > except: > WTF() IMO, that sort of depends on WTF() does. One case where a bare except is well used is when stdandard output/er

RE: Compiling Error prompt

2014-06-20 Thread Ramas Sami
Hi all, when ever I execute the code always on the output prompts this error "C:\Python33\lib\importlib\_bootstrap.py:1532: UserWarning: Module six was already imported from C:\Python33\lib\site-packages\six.py, but c:\python33\lib\site-packages\six-1.6.1-py3.3.egg is being added to sys.path l

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 9:46:29 AM UTC+1, Jamie Mitchell wrote: > Hi folks, > > > > I'm trying to plot a 2D histogram but I'm having some issues: > > from pylab import * > > import numpy as np > > import netCDF4 > > hist,xedges,yedges=np.histogram2d(x,y,bins=10) > > extent=[xedges[0],xedge

Re: Matplotlib Colouring outline of histogram

2014-06-20 Thread Jason Swails
On Fri, Jun 20, 2014 at 4:10 AM, Jamie Mitchell wrote: > Hi folks, > > Instead of colouring the entire bar of a histogram i.e. filling it, I > would like to colour just the outline of the histogram. Does anyone know > how to do this? > Version - Python2.7 > Look at the matplotlib.pyplot.hist fun

Re: how to check if a value is a floating point or not

2014-06-20 Thread Mark Lawrence
On 20/06/2014 14:16, Sturla Molden wrote: Nicholas Cannon wrote: Guys i am only a beginner at python most of the stuff you are saying i need to do i dont understand. Then listen and try to learn :-) But don't use try/except everywhere! Some exceptions might be due to an error in your own co

Re: how to check if a value is a floating point or not

2014-06-20 Thread Sturla Molden
Nicholas Cannon wrote: > Guys i am only a beginner at python most of the stuff you are saying i > need to do i dont understand. Then listen and try to learn :-) In C it is customary to do all sorts of sanity checks in advance. Validating user input is an example. We can call this "to ask permis

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Peter Otten
Jamie Mitchell wrote: > On Friday, June 20, 2014 12:00:15 PM UTC+1, Peter Otten wrote: >> Jamie Mitchell wrote: >> >> >> >> > I have changed my x and y data to float64 types but I am still getting >> > the >> >> > same error message? >> >> >> >> Please double-check by adding >> >> >> >>

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 12:00:15 PM UTC+1, Peter Otten wrote: > Jamie Mitchell wrote: > > > > > I have changed my x and y data to float64 types but I am still getting the > > > same error message? > > > > Please double-check by adding > > > > assert x.dtype == np.float64 > > assert y.dt

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Peter Otten
Jamie Mitchell wrote: > I have changed my x and y data to float64 types but I am still getting the > same error message? Please double-check by adding assert x.dtype == np.float64 assert y.dtype == np.float64 If none of these assertions fail try to make a minimal script including some data tha

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 10:25:44 AM UTC+1, Peter Otten wrote: > Jamie Mitchell wrote: > > > > > Hi folks, > > > > > > I'm trying to plot a 2D histogram but I'm having some issues: > > > from pylab import * > > > import numpy as np > > > import netCDF4 > > > hist,xedges,yedges=np.histogra

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Peter Otten
Jamie Mitchell wrote: > Hi folks, > > I'm trying to plot a 2D histogram but I'm having some issues: > from pylab import * > import numpy as np > import netCDF4 > hist,xedges,yedges=np.histogram2d(x,y,bins=10) > extent=[xedges[0],xedges[-1],yedges[0],yedges[-1]] > imshow(hist.T,extent=extent,inter

Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
Hi folks, I'm trying to plot a 2D histogram but I'm having some issues: from pylab import * import numpy as np import netCDF4 hist,xedges,yedges=np.histogram2d(x,y,bins=10) extent=[xedges[0],xedges[-1],yedges[0],yedges[-1]] imshow(hist.T,extent=extent,interpolation='nearest') colorbar() show() Af

Matplotlib Colouring outline of histogram

2014-06-20 Thread Jamie Mitchell
Hi folks, Instead of colouring the entire bar of a histogram i.e. filling it, I would like to colour just the outline of the histogram. Does anyone know how to do this? Version - Python2.7 Cheers, Jamie -- https://mail.python.org/mailman/listinfo/python-list