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

2014-12-31 Thread George Trojan
ata and mask parts being equal. George On 12/30/2014 11:17 PM, numpy-discussion-requ...@scipy.org wrote: > Message: 1 > Date: Tue, 30 Dec 2014 16:04:36 -0500 > From: Benjamin Root > Subject: Re: [Numpy-discussion] Clarifications in numpy.ma module > To: Discussion of Numerical Python

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 Nand

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

2014-12-30 Thread Maniteja Nandana
On 31-Dec-2014 4:53 am, "Nathaniel Smith" wrote: > > On Tue, Dec 30, 2014 at 10:56 PM, Benjamin Root 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

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 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 of my array)

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 noticed

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 arra

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 wrote: > On Tue, Dec 30, 2014 at 2:49 PM, Benjamin Root 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 computatio

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 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 platforms and had sig

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 1:45 PM, Benjamin Root 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 produce NaNs. Th

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 fo

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 they

[Numpy-discussion] Clarifications in numpy.ma module

2014-12-30 Thread Maniteja Nandana
Hi all, I have recently been trying out various functions in masked array module of numpy. I have got confused at a places in the *core.py *of *ma *module. 1. In the *masked_equal *method, the docstring doesn't suggest that the *fill_value *gets updated by the *value *parameter of the function, b