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

Nathaniel Smith njs at pobox.com
Wed Jul 6 21:27:13 EDT 2011


On Wed, Jul 6, 2011 at 5:41 PM, Lluís <xscript at gmx.net> wrote:
> Sorry, but I didn't find a way of inserting inline comments in the gist.

I'm a little confused about how gists work, actually. For actual
discussion, it's probably just as well, since this way everyone sees
the comment on the list and has a chance to join the conversation...
but I'd be just as happy if other people could just go in and edit it,
and I'm not sure how that works. I'm happy to move to somewhere else
if people have suggestions, this was just easiest.

> 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, ...])

Yeah, that's a much better idea... I've edited it to match.

-- Nathaniel



More information about the NumPy-Discussion mailing list