04.11.2011 20:49, T J kirjoitti:
[clip]
> To push this forward a bit, can I propose that IGNORE behave as:   PnC

The *n* classes can be a bit confusing in Python:

### PnC

 >>> x = np.array([1, 2, 3])
 >>> y = np.array([4, 5, 6])
 >>> ignore(y[1])
 >>> z = x + y
 >>> z
np.array([5, IGNORE(7), 9])
 >>> x += y             # NB: x[1] := x[1] + y[1]
 >>> x
np.array([5, 2, 3])

     ***

I think I defined the "destructive" and "non-destructive" in a different 
way than earlier in the thread. Maybe this behavior from np.ma is closer 
to what was meant earlier:

 >>> x = np.ma.array([1, 2, 3], mask=[0, 0, 1])
 >>> y = np.ma.array([4, 5, 6], mask=[0, 1, 1])
 >>> x += y
 >>> x
masked_array(data = [5 -- --],
              mask = [False  True  True],
        fill_value = 999999)
 >>> x.data
array([5, 2, 3])


Let's call this (since I botched and already reserved the letter "n" :)

(m) mark-ignored

a := SPECIAL_1
# -> a == SPECIAL_a ; the payload of the RHS is neglected,
#                     the assigned value has the original LHS
#                     as the payload

-- 
Pauli Virtanen

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to