[Numpy-discussion] missing data discussion round 2
Tue Jun 28 19:42:46 CDT 2011
On Tue, Jun 28, 2011 at 6:55 PM, Nathaniel Smith <email@example.com> wrote:
> On Tue, Jun 28, 2011 at 4:37 PM, Mark Wiebe <firstname.lastname@example.org> wrote:
> > I've nearly finished this parameter, and decided to call it 'where'
> > 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,
It supports broadcasting, but not arrays of indices.
> -- Nathaniel
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion