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

Mike Ressler mike.ressler at alum.mit.edu
Tue Sep 11 18:49:41 EDT 2007


Thanks, Robert, for the quick response.

On 9/11/07, Robert Kern <robert.kern at 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.

Mike

-- 
mike.ressler at alum.mit.edu



More information about the NumPy-Discussion mailing list