On 10/18/06, Daniel Arbuckle <dj...@hi...> wrote:
> Why does a[b1, b2] not mean the same thing as a[b1][:, b2], when "a"
> is an array and "b1" and "b2" are appropriately sized arrays of
> booleans?
>From my previous experience with R I am used to a[b1, b2] being
equivalent to a[b1][:, b2], so this is a little strange to me as well.
In numpy I think you need to use the function ix_ to get the cross
product.
e.g. a[ix_(b1,b2)] is equivalent to a[b1][:, b2]
a[b1,b2] raises an error about a type mismatch. I have no idea what
this syntax is supposed to do in numpy.
|