[Numpy-discussion] miniNEP1: where= argument for ufuncs

Lluís xscript at gmx.net
Wed Jul 6 20:41:28 EDT 2011


Sorry, but I didn't find a way of inserting inline comments in the gist.

Nathaniel Smith writes:
[...]
> Is there any less stupid-looking name than ``where1=`` and ``where2=``
> for the ``.outer`` operation? (For that matter, can ``.outer`` be
> applied to more than 2 arrays? The docs say it can't, but it's
> perfectly well-defined for arbitrary number of arrays too, so maybe we
> want an interface that allows for 3-way, 4-way etc. ``.outer``
> operations in the future?)

Well, if outer can indeed be defined for an arbitrary number of arrays
(and if it's going to be sometime in the future), I'd say the simplest
is to use an array:

    .outer(a, b, ..., where = [my_where1, my_where2, ...])


Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



More information about the NumPy-Discussion mailing list