On Tue, Jun 28, 2011 at 6:55 PM, Nathaniel Smith <njs@pobox.com> wrote:
On Tue, Jun 28, 2011 at 4:37 PM, Mark Wiebe <mwwiebe@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@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion