You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think ma ufuncs do anything with out -- in your example, a contains a regular array, while the output is a masked array. Specifically,
ma = np.ma.add([1,1], 2, out=a)
ma.data.base is a
# True
Looking at the code, __array_wrap__ simply views the output of the ufunc (i.e., a) as a MaskedArray and then goes through its logic with the mask. To get this right, one would have to use __array_prepare__ to turn the output array into a masked version before filling it in the calculation.
The ufuncs defined for
MaskedArrays
don't returnout
if it is supplied as a keyword, unlike normal ufuncs.The text was updated successfully, but these errors were encountered: