[Numpy-discussion] missing data discussion round 2

Mark Wiebe mwwiebe@gmail....
Thu Jun 30 10:07:58 CDT 2011


On Wed, Jun 29, 2011 at 1:20 PM, Lluís <xscript@gmx.net> wrote:

> Mark Wiebe writes:
>
> > There seems to be a general idea that masks and NA bit patterns imply
> > particular differing semantics, something which I think is simply
> > false.
>
> Well, my example contained a difference (the need for the "skipna=True"
> argument) precisely because it seemed that there was some need for
> different defaults.
>
> Honestly, I think this difference breaks the POLA (principle of least
> astonishment).
>
>
> [...]
> > As far as I can tell, the only required difference between them is
> > that NA bit patterns must destroy the data. Nothing else. Everything
> > on top of that is a choice of API and interface mechanisms. I want
> > them to behave exactly the same except for that necessary difference,
> > so that it will be possible to use the *exact same Python code* with
> > either approach.
>
> I completely agree. What I'd suggest is a global and/or per-object
> "ndarray.flags.skipna" for people like me that just want to ignore these
> entries without caring about setting it on each operaion (or the other
> way around, depends on the default behaviour).
>
> The downside is that it adds yet another tweaking knob, which is not
> desirable...
>

One way around this would be to create an ndarray subclass which changes
that default. Currently this would not be possible to do nicely, but with
the _numpy_ufunc_ idea I proposed in a separate thread a while back, this
could work.

-Mark


>
>
> Lluis
>
> --
>  "And it's much the same thing with knowledge, for whenever you learn
>  something new, the whole world becomes that much richer."
>  -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
>  Tollbooth
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110630/cdb4e921/attachment.html 


More information about the NumPy-Discussion mailing list