Re: [Numpy-discussion] Clarifications in numpy.ma module (Benjamin Root)

2014-12-31 Thread George Trojan
: Message: 1 Date: Tue, 30 Dec 2014 16:04:36 -0500 From: Benjamin Root ben.r...@ou.edu Subject: Re: [Numpy-discussion] Clarifications in numpy.ma module To: Discussion of Numerical Python numpy-discussion@scipy.org Message-ID: CANNq6Fk4XTMcXeb64C9FWWnjWsVVK=Ri7CsGLsbE2wr=z-r...@mail.gmail.com

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Maniteja Nandana
Guys, sorry for the incomplete message, *_DomainedBinaryOperation *for divide remainder Related to issue 5354, where the docstring for _*MaskedBinaryOperation *says that invalid values are pre-masked*, but for **_DomainedBinaryOperation *where the invalid values are masked in result, even if

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Benjamin Root
What do you mean that the mean function doesn't take care of the case where the array is empty? In the example you provided, they both end up being NaN, which is exactly correct. Ben Root On Tue, Dec 30, 2014 at 6:10 AM, Maniteja Nandana maniteja.modesty...@gmail.com wrote: Guys, sorry for

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Alexander Belopolsky
On Tue, Dec 30, 2014 at 1:45 PM, Benjamin Root ben.r...@ou.edu wrote: What do you mean that the mean function doesn't take care of the case where the array is empty? In the example you provided, they both end up being NaN, which is exactly correct. Operations on masked arrays should not

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Benjamin Root
Where does it say that operations on masked arrays should not produce NaNs? Operations on masked arrays should ignore masked data. If I have NaNs in my masked array, but are not masked out for some reason, I expect it to give me NaNs. The mask is not the same as NaNs. Having np.mean([]) return the

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Alexander Belopolsky
On Tue, Dec 30, 2014 at 2:49 PM, Benjamin Root ben.r...@ou.edu wrote: Where does it say that operations on masked arrays should not produce NaNs? Masked arrays were invented with the specific goal to avoid carrying NaNs in computations. Back in the days, NaNs were not available on some

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Benjamin Root
On Tue, Dec 30, 2014 at 3:29 PM, Alexander Belopolsky ndar...@mac.com wrote: On Tue, Dec 30, 2014 at 2:49 PM, Benjamin Root ben.r...@ou.edu wrote: Where does it say that operations on masked arrays should not produce NaNs? Masked arrays were invented with the specific goal to avoid

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Maniteja Nandana
I was just referring to the exception raised in the case where the length of the array is zero. I have not thought if the example provided by @Alexander. I was also wondering if the automatic masking of NaN should be done or not, which is why I asked about the difference in the operating named

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Benjamin Root
exception? Did you mean warning? If warning, I recall some discussion recently to figure out a way to hide that, but only for masked values (I would want to see the warning if I do bad calculations in the unmasked portions of my array). Now I see your point 3 much more clearly. I had never

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Nathaniel Smith
On Tue, Dec 30, 2014 at 10:56 PM, Benjamin Root ben.r...@ou.edu wrote: exception? Did you mean warning? If warning, I recall some discussion recently to figure out a way to hide that, but only for masked values (I would want to see the warning if I do bad calculations in the unmasked portions

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Maniteja Nandana
On 31-Dec-2014 4:53 am, Nathaniel Smith n...@pobox.com wrote: On Tue, Dec 30, 2014 at 10:56 PM, Benjamin Root ben.r...@ou.edu wrote: exception? Did you mean warning? If warning, I recall some discussion recently to figure out a way to hide that, but only for masked values (I would want to

Re: [Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Benjamin Root
Maniteja, Careful with advertising that you are reading up on any under-maintained codebases. I did that for mplot3d four years ago and the previous maintainer said tag! you're it! I haven't been able to tag anyone since then... Cheers! Ben Root On Tue, Dec 30, 2014 at 6:34 PM, Maniteja