Re: [Matplotlib-users] zero division: warning and exception

2009-05-14 Thread Armin Moser
darkside schrieb: > Hi list, > I have to make a division that sometimes yields and inf, and I want to > replace it by 0. > I have try this: > --- > import pylab as p > p.seterr(divide='raise') > l = array vector defined along the program > try: >

Re: [Matplotlib-users] zero division: warning and exception

2009-05-14 Thread John Hunter
On Thu, May 14, 2009 at 7:26 PM, darkside wrote: > Hi list, > I have to make a division that sometimes yields and inf, and I want to > replace it by 0. > I have try this: > --- > import pylab as p > p.seterr(divide='raise') > l = array vector defined along the p

[Matplotlib-users] zero division: warning and exception

2009-05-14 Thread darkside
Hi list, I have to make a division that sometimes yields and inf, and I want to replace it by 0. I have try this: --- import pylab as p p.seterr(divide='raise') l = array vector defined along the program try: a = (dr*R*dl)/(1.-((R0/R)*p.sin(l))**2