Re: [Numpy-discussion] What should be the result in some statistics corner cases?

2013-07-14 Thread Charles R Harris
On Sun, Jul 14, 2013 at 2:55 PM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > On 7/14/13, Charles R Harris wrote: > > Some corner cases in the mean, var, std. > > > > *Empty arrays* > > > > I think these cases should either raise an error or just return nan. > > Warnings seem ineffecti

Re: [Numpy-discussion] What should be the result in some statistics corner cases?

2013-07-14 Thread Warren Weckesser
On 7/14/13, Charles R Harris wrote: > Some corner cases in the mean, var, std. > > *Empty arrays* > > I think these cases should either raise an error or just return nan. > Warnings seem ineffective to me as they are only issued once by default. > > In [3]: ones(0).mean() > /home/charris/.local/li

[Numpy-discussion] What should be the result in some statistics corner cases?

2013-07-14 Thread Charles R Harris
Some corner cases in the mean, var, std. *Empty arrays* I think these cases should either raise an error or just return nan. Warnings seem ineffective to me as they are only issued once by default. In [3]: ones(0).mean() /home/charris/.local/lib/python2.7/site-packages/numpy/core/_methods.py:61:

Re: [Numpy-discussion] read-only or immutable masked array

2013-07-14 Thread Pierre GM
On Jul 13, 2013, at 13:36 , Gregorio Bastardo wrote: > Hi Stéfan, > > Thanks for the suggestion, but it does not protect the array: Thinking about it, it can't: when `x` is a MaskedArray, `x.data` is just a view of the underlying array as a regular ndarray. As far as I understand, changing