[Numpy-discussion] Slicing/selection in multiple dimensions simultaneously

Mike Ressler mike.ressler@alum.mit....
Tue Sep 11 17:49:41 CDT 2007

Thanks, Robert, for the quick response.

On 9/11/07, Robert Kern <robert.kern@gmail.com> wrote:
> There are operations you can express with this form that you couldn't if the
> behavior that you expected were the case whereas you can get the result you want
> relatively straightforwardly.
> In [6]: a[q[:,newaxis], r]

Ah, yes, of course. I forgot my broadcasting rules. However, I also
thank Timothy Hochberg for the moral support of agreeing that the
obvious way (a[q,r]) should be reasonably expected to work.

Thanks again for your help - the routine is now working nicely.



More information about the Numpy-discussion mailing list