Re: [Numpy-discussion] Documentation examples with doc

2007-04-30 Thread Robert Kern
Martin Blais wrote: > Hi > > Where is the script that generates the Numpy Examples with Doc on the > scipy website? > I cannot find it in the numpy svn. > Maybe I would like to create a version that generates LaTeX for > Python-style documentation. I find searching through this big web > page a s

[Numpy-discussion] Documentation examples with doc

2007-04-30 Thread Martin Blais
Hi Where is the script that generates the Numpy Examples with Doc on the scipy website? I cannot find it in the numpy svn. Maybe I would like to create a version that generates LaTeX for Python-style documentation. I find searching through this big web page a slightly painful experience. thanks,

Re: [Numpy-discussion] simpliest way to check: array x is float, not integer

2007-04-30 Thread Christopher Barker
dmitrey wrote: > hi all, > please inform me what is the simplest way to check, does the vector x > that came to my func is float or integer. I.e. someone can pass to my > func for example x0 = numpy.array([1, 0, 0]) and it can yield wrong > unexpected results vs numpy.array([1.0, 0, 0]) . Usual

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread David Goldsmith
Timothy Hochberg wrote: > > > On 4/30/07, *David Goldsmith* <[EMAIL PROTECTED] > > wrote: > > > > (hint what is arctan(0+1j)?) > > > Well, at the risk of embarrassing myself, using arctan(x+iy) = I get: > > arctan(0+1i) = -i*log((0+i*1)/sqrt(0^2 + 1^2)) =

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread David Goldsmith
lorenzo bolla wrote: > hold on, david. the formula I posted previously from wolfram is > ArcTan[x,y] with x or y complex: its the same of arctan2(x,y). arctan > is another function (even though arctan2(y,x) should be "a better" > arctan(y/x)). > > the correct formula for y = arctan(x), with any

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread lorenzo bolla
hold on, david. the formula I posted previously from wolfram is ArcTan[x,y] with x or y complex: its the same of arctan2(x,y). arctan is another function (even though arctan2(y,x) should be "a better" arctan(y/x)). the correct formula for y = arctan(x), with any x (real or complex), should be (if

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread Timothy Hochberg
On 4/30/07, David Goldsmith <[EMAIL PROTECTED]> wrote: > (hint what is arctan(0+1j)?) > Well, at the risk of embarrassing myself, using arctan(x+iy) = I get: arctan(0+1i) = -i*log((0+i*1)/sqrt(0^2 + 1^2)) = -i*log(i/1) = -i*log(i) = -i*log(exp(i*pi/2)) = -i*i*pi/2 = pi/2... Is there some reas

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread David Goldsmith
> (hint what is arctan(0+1j)?) > Well, at the risk of embarrassing myself, using arctan(x+iy) = I get: arctan(0+1i) = -i*log((0+i*1)/sqrt(0^2 + 1^2)) = -i*log(i/1) = -i*log(i) = -i*log(exp(i*pi/2)) = -i*i*pi/2 = pi/2... Is there some reason I'm forgetting (e.g., a branch cut convention or so

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread Timothy Hochberg
On 4/30/07, David Goldsmith <[EMAIL PROTECTED]> wrote: lorenzo bolla wrote: > me! > I have two cases. > >1. I need that arctan2(1+0.0001j,1-0.01j) gives something > close to arctan2(1,1): any decent analytic prolungation will do! > This is the foreseeable use case described by

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread David Goldsmith
lorenzo bolla wrote: > me! > I have two cases. > >1. I need that arctan2(1+0.0001j,1-0.01j) gives something > close to arctan2(1,1): any decent analytic prolungation will do! > This is the foreseeable use case described by Anne. In any event, I stand not only corrected, but embar

Re: [Numpy-discussion] can't import repmat from numpy

2007-04-30 Thread Bill Baxter
It's not on the matlab page simpy because numpy.tile didn't exist when the page was created. It should be fixed. But repmat is still there in numpy.matlib (I think that was what it was called.) --bb On 4/30/07, dmitrey <[EMAIL PROTECTED]> wrote: > if it was excluded for any reasons, correspondin

Re: [Numpy-discussion] can't import repmat from numpy

2007-04-30 Thread dmitrey
if it was excluded for any reasons, corresponding changes in http://www.scipy.org/NumPy_for_Matlab_Users should be done D. lorenzo bolla wrote: > it looks like repmat is not there anymore... why? > use numpy.repeat and numpy.tile, instead! > hth, > lorenzo. > > On 4/30/07, *dmitrey* < [EMAIL PROT

Re: [Numpy-discussion] can't import repmat from numpy

2007-04-30 Thread Pauli Virtanen
dmitrey kirjoitti: > What's wrong? > > start python shell; > > from numpy import sin => all ok > > from numpy import repmat => > Traceback (most recent call last): > File "", line 1, in > ImportError: cannot import name repmat In numpy, the equivalent function is called tile: >>> from num

Re: [Numpy-discussion] can't import repmat from numpy

2007-04-30 Thread lorenzo bolla
it looks like repmat is not there anymore... why? use numpy.repeat and numpy.tile, instead! hth, lorenzo. On 4/30/07, dmitrey <[EMAIL PROTECTED]> wrote: What's wrong? start python shell; from numpy import sin => all ok from numpy import repmat => Traceback (most recent call last): File "

Re: [Numpy-discussion] arctan2 with complex args

2007-04-30 Thread lorenzo bolla
me! I have two cases. 1. I need that arctan2(1+0.0001j,1-0.01j) gives something close to arctan2(1,1): any decent analytic prolungation will do! 2. if someone of you is familiar with electromagnetic problems, in particular with Snell's law, will recognize that in case of total i