[Numpy-discussion] in the NA discussion, what can we agree on?

Lluís xscript@gmx....
Fri Nov 4 11:08:16 CDT 2011


Gary Strangman writes:
[...]
> Given I'm still fuzzy on all the distinctions, perhaps someone could try to help
> me (and others?) to define all /4/ logical possibilities ... some may be obvious
> dead-ends. I'll take a stab at them, but these should definitely get edited by
> others:

> destructive + propagating = the data point is truly missing (satellite fell into
> the ocean; dog ate my source datasheet, or whatever), this is the nature of that
> data point, such missingness should be replicated in elementwise operations, and
> the missingness SHOULD interfere with reduction operations that involve that
> datapoint (np.sum([1,MISSING])=MISSING)

Right.


> destructive + non-propagating = the data point is truly missing, this is the
> nature of that data point, such missingness should be replicated in elementwise
> operations, but such missingness should NOT interfere with reduction operations
> that involve that datapoint (np.sum([1,MISSING])=1)

What do you define as element-wise operations?

Is a sum on an array an element-wise operation?

  >>> [1, MISSING]+2
  [1, MISSING]

Or is it just a form of reduction (after shape broadcasting)?

  >>> [1, MISSING]+2
  [3, 2]

For me it's the second, so the only time where special values "propagate" in a
non-propagating scenario is when you slice an array.


> non-destructive + propagating = I want to ignore this datapoint for now;
> element-wise operations should replicate this "ignore" designation, and
> missingness of this type SHOULD interfere with reduction operations that involve
> this datapoint (np.sum([1,IGNORE])=IGNORE)

Right.


> non-destructive + non-propagating = I want to ignore this datapoint for now;
> element-wise operations should replicate this "ignore" designation, but
> missingness of this type SHOULD NOT interfere with reduction operations that
> involve this datapoint (np.sum([1,IGNORE])=1)

Same concerns as above.


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


More information about the NumPy-Discussion mailing list