Re: [Numpy-discussion] new numpy.org is live

2020-05-25 Thread Travis Oliphant
This is so excellent! What a wonderful upgrade to the web-page. Thank you for all the hard work and effort! -Travis On Sun, May 24, 2020 at 7:12 AM Inessa Pawson wrote: > The NumPy web team is excited to announce the launch of the newly > redesigned numpy.org. To transform the website into

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Robert Kern
On Mon, May 25, 2020 at 11:17 AM Sebastian Berg wrote: > On Mon, 2020-05-25 at 11:10 -0400, Robert Kern wrote: > > On Mon, May 25, 2020 at 10:36 AM Sebastian Berg < > > sebast...@sipsolutions.net> > > wrote: > > > > > On Mon, 2020-05-25 at 10:09 -0400, Brian Racey wrote: > > > > Would a "complex

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Ilhan Polat
I wasted a good 2 weeks because of that behavior of Matlab back in the day and I think that is one of the cardinal sins that matlab commits. If need be there are alternatives as mentioned before but I definitely do not prefer this coercion at all. On Mon, May 25, 2020 at 5:18 PM Sebastian Berg

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Brian Racey
My Googling revealed none of this. I don't have anyone to talk to about using numpy, so Google (and this group) is all I have. This was extremely useful: https://numpy.org/devdocs/user/numpy-for-matlab-users.html so perhaps it could be extended to point out those modules and entry points if it

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Sebastian Berg
On Mon, 2020-05-25 at 11:10 -0400, Robert Kern wrote: > On Mon, May 25, 2020 at 10:36 AM Sebastian Berg < > sebast...@sipsolutions.net> > wrote: > > > On Mon, 2020-05-25 at 10:09 -0400, Brian Racey wrote: > > > Would a "complex default" mode ever make it into numpy, to behave > > > more like > >

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Robert Kern
On Mon, May 25, 2020 at 10:36 AM Sebastian Berg wrote: > On Mon, 2020-05-25 at 10:09 -0400, Brian Racey wrote: > > Would a "complex default" mode ever make it into numpy, to behave > > more like > > Matlab and other packages with respect to complex number handling? > > Sure it > > would make it

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Tiziano Zito
Would a "complex default" mode ever make it into numpy, to behave more like Matlab and other packages with respect to complex number handling? Sure it would make it marginally slower if enabled, but it might open the door to better compatibility when porting code to Python. numpy already has

Re: [Numpy-discussion] new numpy.org is live

2020-05-25 Thread Ralf Gommers
On Sun, May 24, 2020 at 8:19 PM Stephen Waterbury wrote: > This is an absolutely beautiful and very informative site! > It is clear all the work and thought that went into it. > > So please take the following input as a constructive suggestion > from an outsider -- I am a long-time (30-year)

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Sebastian Berg
On Mon, 2020-05-25 at 10:09 -0400, Brian Racey wrote: > Thanks. That is for performance and memory which of course is valid > for > most use cases. Would it really be much different than doing > type/size > checking of all the np.array arguments to a function to ensure the > appropriate final

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Brian Racey
Being relatively new to numpy, I'm learning as I go. Your typing suggestion helped me come to the conclusion that I need to type and coerce my input arguments as I'm doing complex math. My test arguments were real, and thus numpy was producing real results. Doing .astype(np.complex128) to my input

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Brian Racey
Thanks. That is for performance and memory which of course is valid for most use cases. Would it really be much different than doing type/size checking of all the np.array arguments to a function to ensure the appropriate final np.array sizes are allocated? I'm not trying to question current

Re: [Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Eric Wieser
One explanation for this behavior is that doing otherwise would be slow. Consider an array like arr = np.array([1]*10**6 + [-1]) ret = np.log(arr) Today, what happens is: - The output array is allocated as np.double - The input array is iterated over, and log evaluated on each element in

[Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

2020-05-25 Thread Brian Racey
Why does numpy produce a runtime warning (invalid value encountered in log) when taking the log of a negative number? I noticed that if you coerce the argument to complex by adding 0j to the negative number, the expected result is produced (i.e. ln(-1) = pi*i). I was surprised I couldn't find a

Re: [Numpy-discussion] new numpy.org is live

2020-05-25 Thread kikocorreoso
Hi all, Great job!! Congratulations. In the "Ecosystem" -> "Scientific Domains" section, I think the links for "bayesian inference" and "bio informatics" are wrong. The ones in "bayesian inference" should appear in "bio informatics" and vice versa. Also, in the "geographic processing" area