[Numpy-discussion] What is consensus anyway

Charles R Harris charlesr.harris@gmail....
Tue Apr 24 13:32:12 CDT 2012

On Tue, Apr 24, 2012 at 12:12 PM, Charles R Harris <
charlesr.harris@gmail.com> wrote:

> On Tue, Apr 24, 2012 at 9:25 AM, <josef.pktd@gmail.com> wrote:
>> On Tue, Apr 24, 2012 at 9:43 AM, Pierre Haessig
>> <pierre.haessig@crans.org> wrote:
>> > Hi,
>> >
>> > Le 24/04/2012 15:14, Charles R Harris a écrit :
>> >>
>> >> a) All arrays should be implicitly masked, even if the mask isn't
>> >> initially allocated. The maskna keyword can then be removed, taking
>> >> with it the sense that there are two kinds of arrays.
>> >>
>> >
>> > From my lazy user perspective, having masked and non-masked arrays share
>> > the same "look and feel" would be a number one advantage over the
>> > existing numpy.ma arrays. I would like masked array to be as
>> transparent
>> > as possible.
>> I don't have any opinion about internal implementation.
>> But users needs to be aware of whether they have masked arrays or not.
>> Since many functions (most of scipy) wouldn't know how to handle NA
>> and don't do any checks, (and shouldn't in my opinion if the NA check
>> is costly). The result might be silently wrong numbers depending on
>> the implementation.
> There should be a flag saying whether or not NA has been allocated and
> allocation happens when NA is assigned to an array item, so that should be
> fast. I don't think scipy currently deals with masked arrays in all areas,,
> so I believe that the same problem exists there and would also exist for
> missing data types. I think this sort of compatibility problem is worth a
> whole discussion by itself.

To clarify a bit, a item could be marked as both missing and ignore. An
item that is marked missing will propagate as missing, but if it is also
ignored then things like mean and std will skip it. There would also be a
clear operation that would clear the ignore bit but keep the missing bit.
Now I can see the advantage of explicitly specifying behavior in functions
as one is knows right at the spot what is intended whereas with the other
alternative one needs to know the history of the array and whether ignore
was ever set, but in that sense it is just like having default keyword
values and could be implemented as such.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120424/a26631d7/attachment.html 

More information about the NumPy-Discussion mailing list