[Numpy-discussion] missing data discussion round 2

Mark Wiebe mwwiebe at gmail.com
Tue Jun 28 20:42:46 EDT 2011


On Tue, Jun 28, 2011 at 6:55 PM, Nathaniel Smith <njs at pobox.com> wrote:

> On Tue, Jun 28, 2011 at 4:37 PM, Mark Wiebe <mwwiebe at gmail.com> wrote:
> > I've nearly finished this parameter, and decided to call it 'where'
> instead,
> > because it is operating like an SQL where clause. Here if neither a nor b
> > are masked array it will only modify those values of b where the 'where'
> > parameter has the value True.
>
> Probably a good idea, since in the current NEP, masks do not have a
> 'where' clause effect (at least for reduction operations), unless you
> pass skipna=True. So calling it mask= would be a bit confusing :-)
>
> So if I understand right,
>  f(a, b, where=c)
> is basically an optimized (copy-avoiding) version of
>  f(a[c], b[c])
> ?


Yes, of 'b[c] = f(a[c], b[c])'.


> Except, in this case, c must be a boolean array of exactly the right
> shape, you don't support broadcasting or integer arrays or slices,
> etc.?
>

It supports broadcasting, but not arrays of indices.

-Mark


>
> -- Nathaniel
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110628/9a5594c0/attachment.html>


More information about the NumPy-Discussion mailing list