Re: [Numpy-discussion] 1.8.0rc1

2013-10-02 Thread Christoph Gohlke
On 9/30/2013 8:17 AM, Charles R Harris wrote: Hi All, NumPy 1.8.0rc1 is up now on sourceforge http://sourceforge.net/projects/numpy/files/NumPy/1.8.0rc1/ .The binary builds are included except for Python 3.3 on windows, which will arrive later. Many thanks to Ralf for the binaries, and to those

Re: [Numpy-discussion] 1.8.0rc1

2013-10-02 Thread Nathaniel Smith
This is a complicated issue to describe but i think the bottom line is that the test is just wonky here. the behaviour it's checking for is: wrong in old numpy, but we do it anyway (bug) wrong in current numpy without RELAXED_STRIDES, and we get it right (I.e. don't do it, fixed bug) correct in

Re: [Numpy-discussion] 1.8.0rc1

2013-10-02 Thread Sebastian Berg
On Wed, 2013-10-02 at 10:04 +0100, Nathaniel Smith wrote: This is a complicated issue to describe but i think the bottom line is that the test is just wonky here. the behaviour it's checking for is: wrong in old numpy, but we do it anyway (bug) wrong in current numpy without RELAXED_STRIDES,

Re: [Numpy-discussion] 1.8.0rc1

2013-10-02 Thread Sebastian Berg
On Wed, 2013-10-02 at 12:54 +0200, Sebastian Berg wrote: On Wed, 2013-10-02 at 10:04 +0100, Nathaniel Smith wrote: This is a complicated issue to describe but i think the bottom line is that the test is just wonky here. the behaviour it's checking for is: wrong in old numpy, but we do it

Re: [Numpy-discussion] [SciPy-Dev] 1.8.0rc1

2013-10-02 Thread Stéfan van der Walt
Hi Chuck On Tue, Oct 1, 2013 at 1:07 AM, Charles R Harris charlesr.har...@gmail.com wrote: I'll bet the skimage problems come from https://github.com/numpy/numpy/pull/3811. They may be doing something naughty... Reverting that commit fixes those skimage failures. However, there are a

Re: [Numpy-discussion] [SciPy-Dev] 1.8.0rc1

2013-10-02 Thread Charles R Harris
Hi Stefan, On Wed, Oct 2, 2013 at 9:29 AM, Stéfan van der Walt ste...@sun.ac.zawrote: Hi Chuck On Tue, Oct 1, 2013 at 1:07 AM, Charles R Harris charlesr.har...@gmail.com wrote: I'll bet the skimage problems come from https://github.com/numpy/numpy/pull/3811. They may be doing something

[Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Charles R Harris
Hi All, The question is what to do when all-nan slices are encountered in the nan{max,min} and nanarg{max, min} functions. Currently in 1.8.0, the first returns nan and raises a warning, the second returns intp.min and raises a warning. It is proposed that the nanarg{max, min} functions, and

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Nathaniel Smith
+1 to making the nan functions consistent with the non-nan functions. On 2 Oct 2013 17:03, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, The question is what to do when all-nan slices are encountered in the nan{max,min} and nanarg{max, min} functions. Currently in 1.8.0, the first

Re: [Numpy-discussion] [SciPy-Dev] 1.8.0rc1

2013-10-02 Thread Benjamin Root
On Wed, Oct 2, 2013 at 11:43 AM, Charles R Harris charlesr.har...@gmail.com wrote: Hi Stefan, On Wed, Oct 2, 2013 at 9:29 AM, Stéfan van der Walt ste...@sun.ac.zawrote: Hi Chuck On Tue, Oct 1, 2013 at 1:07 AM, Charles R Harris charlesr.har...@gmail.com wrote: I'll bet the skimage

Re: [Numpy-discussion] [SciPy-Dev] 1.8.0rc1

2013-10-02 Thread Charles R Harris
On Wed, Oct 2, 2013 at 10:12 AM, Benjamin Root ben.r...@ou.edu wrote: On Wed, Oct 2, 2013 at 11:43 AM, Charles R Harris charlesr.har...@gmail.com wrote: Hi Stefan, On Wed, Oct 2, 2013 at 9:29 AM, Stéfan van der Walt ste...@sun.ac.zawrote: Hi Chuck On Tue, Oct 1, 2013 at 1:07 AM,

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Stéfan van der Walt
On 2 Oct 2013 18:04, Charles R Harris charlesr.har...@gmail.com wrote: The question is what to do when all-nan slices are encountered in the nan{max,min} and nanarg{max, min} functions. Currently in 1.8.0, the first returns nan and raises a warning, the second returns intp.min and raises a

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread josef . pktd
On Wed, Oct 2, 2013 at 12:37 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 18:04, Charles R Harris charlesr.har...@gmail.com wrote: The question is what to do when all-nan slices are encountered in the nan{max,min} and nanarg{max, min} functions. Currently in 1.8.0, the first

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Charles R Harris
On Wed, Oct 2, 2013 at 10:56 AM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 12:37 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 18:04, Charles R Harris charlesr.har...@gmail.com wrote: The question is what to do when all-nan slices are encountered in the

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Benjamin Root
On Wed, Oct 2, 2013 at 1:05 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Wed, Oct 2, 2013 at 10:56 AM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 12:37 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 18:04, Charles R Harris charlesr.har...@gmail.com

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Stéfan van der Walt
On 2 Oct 2013 19:14, Benjamin Root ben.r...@ou.edu wrote: And it is logically consistent, I think. a[nanargmax(a)] == nanmax(a) (ignoring the silly detail that you can't do an equality on nans). Why do you call this a silly detail? It seems to me a fundamental flaw to this approach. Stéfan

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread josef . pktd
On Wed, Oct 2, 2013 at 2:05 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 19:14, Benjamin Root ben.r...@ou.edu wrote: And it is logically consistent, I think. a[nanargmax(a)] == nanmax(a) (ignoring the silly detail that you can't do an equality on nans). Why do you call this

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread josef . pktd
On Wed, Oct 2, 2013 at 2:49 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:05 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 19:14, Benjamin Root ben.r...@ou.edu wrote: And it is logically consistent, I think. a[nanargmax(a)] == nanmax(a) (ignoring the silly detail

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Benjamin Root
On Wed, Oct 2, 2013 at 2:05 PM, Stéfan van der Walt ste...@sun.ac.zawrote: On 2 Oct 2013 19:14, Benjamin Root ben.r...@ou.edu wrote: And it is logically consistent, I think. a[nanargmax(a)] == nanmax(a) (ignoring the silly detail that you can't do an equality on nans). Why do you call

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Nathaniel Smith
On Wed, Oct 2, 2013 at 7:51 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:49 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:05 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 19:14, Benjamin Root ben.r...@ou.edu wrote: And it is logically consistent, I

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Charles R Harris
On Wed, Oct 2, 2013 at 12:51 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:49 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:05 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2 Oct 2013 19:14, Benjamin Root ben.r...@ou.edu wrote: And it is logically consistent,

[Numpy-discussion] MATLAB fsolve now available in Python

2013-10-02 Thread Dmitrey
Hi all, New solver for systems of nonlinear equations ( SNLE ) has been connected to free Python framework OpenOpt: fsolve from  MATLAB   Optimization Toolbox; uploaded into PYPI in v. 0.5112. As well as fmincon , currently it's available for Python 2 only. Unlike scipy.optimize fsolve, it

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Nathaniel Smith
On Wed, Oct 2, 2013 at 8:19 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Oct 2, 2013 at 12:51 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:49 PM, josef.p...@gmail.com wrote: On Wed, Oct 2, 2013 at 2:05 PM, Stéfan van der Walt ste...@sun.ac.za wrote: On 2

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-02 Thread Stéfan van der Walt
On 2 Oct 2013 21:19, Charles R Harris charlesr.har...@gmail.com wrote: The main problem I had was deciding what arg{max, min} should return as the return value is an integer. I like your suggestion of returning 0. This doesn't allow the user to know the difference between valid and invalid

[Numpy-discussion] 1.8.0, nan functions, and pandas

2013-10-02 Thread Charles R Harris
Hi All, There was a problem with pandas 0.12 and the numpy nan functions when applying the nansum function to a pandas Series object. We thought we had fixed it by the slight of hand use of `a.sum` instead of `add.reduce(a)` so that the Series object could use its own version of `sum` which

Re: [Numpy-discussion] 1.8.0, nan functions, and pandas

2013-10-02 Thread Charles R Harris
On Wed, Oct 2, 2013 at 5:29 PM, Charles R Harris charlesr.har...@gmail.comwrote: Hi All, There was a problem with pandas 0.12 and the numpy nan functions when applying the nansum function to a pandas Series object. We thought we had fixed it by the slight of hand use of `a.sum` instead of

[Numpy-discussion] Products of small float32 values.

2013-10-02 Thread Dave Cook
Can someone explain what is going on here? In [153]: small = ones(1, dtype='float32') In [154]: small Out[154]: array([ 1.], dtype=float32) In [155]: small*1e-45 Out[155]: array([ 1.40129846e-45], dtype=float32) In [156]: small*1e-46 Out[156]: array([ 0.], dtype=float32) I would

Re: [Numpy-discussion] Products of small float32 values.

2013-10-02 Thread Matthew Brett
Hi, On Wed, Oct 2, 2013 at 6:00 PM, Dave Cook dav...@gmail.com wrote: Can someone explain what is going on here? In [153]: small = ones(1, dtype='float32') In [154]: small Out[154]: array([ 1.], dtype=float32) In [155]: small*1e-45 Out[155]: array([ 1.40129846e-45],

Re: [Numpy-discussion] Products of small float32 values.

2013-10-02 Thread Dave Cook
On Wed, Oct 2, 2013 at 6:06 PM, Matthew Brett matthew.br...@gmail.comwrote: Is it possible you are thinking of 2**-126 rather than 10**-126? Yup, brainfart... In [3]: print np.finfo(np.float32) Machine parameters for float32