Re: [Numpy-discussion] Indexing by label in 3rd dimension

2011-09-19 Thread Benjamin Landenberger
Great! Thank you! On 16/09/2011 17:43, Warren Weckesser wrote: > > > On Fri, Sep 16, 2011 at 10:18 AM, Benjamin Landenberger > > wrote: > > Hello list! > > I have an array *mask* of shape (a, b) and another array *intensities* >

Re: [Numpy-discussion] Indexing by label in 3rd dimension

2011-09-16 Thread Warren Weckesser
On Fri, Sep 16, 2011 at 10:18 AM, Benjamin Landenberger < benjamin.landenber...@imtek.uni-freiburg.de> wrote: > Hello list! > > I have an array *mask* of shape (a, b) and another array *intensities* > of shape (N, a, b), where the values in *mask* range from 0 to N-1. It > is somehow similar to la

Re: [Numpy-discussion] Indexing by label in 3rd dimension

2011-09-16 Thread Benjamin Root
On Friday, September 16, 2011, Benjamin Root wrote: > > > On Friday, September 16, 2011, Benjamin Landenberger < benjamin.landenber...@imtek.uni-freiburg.de> wrote: >> Hello list! >> >> I have an array *mask* of shape (a, b) and another array *intensities* >> of shape (N, a, b), where the values i

Re: [Numpy-discussion] Indexing by label in 3rd dimension

2011-09-16 Thread Benjamin Root
On Friday, September 16, 2011, Benjamin Landenberger < benjamin.landenber...@imtek.uni-freiburg.de> wrote: > Hello list! > > I have an array *mask* of shape (a, b) and another array *intensities* > of shape (N, a, b), where the values in *mask* range from 0 to N-1. It > is somehow similar to label

[Numpy-discussion] Indexing by label in 3rd dimension

2011-09-16 Thread Benjamin Landenberger
Hello list! I have an array *mask* of shape (a, b) and another array *intensities* of shape (N, a, b), where the values in *mask* range from 0 to N-1. It is somehow similar to label arrays in scipy.ndimage. Now I want to pick those entries from the first dimension of *intensities* which are given