Re: [Numpy-discussion] simple array multiplication question

2009-10-12 Thread David Warde-Farley
On 12-Oct-09, at 11:53 PM, per freem wrote: > what i want to do is pick the columns l of p, and multiply each one by > the numbers in s. the first step, picking columns l of p, is simply: > > cols = p[arange(3), l] This isn't picking columns of p, this is picking the times at (0, 0), (1, 0), a

[Numpy-discussion] simple array multiplication question

2009-10-12 Thread per freem
hi all, i am trying to write a simple product of 3 arrays (as vectorized code) but am having some difficulty. i have three arrays, one is a list containing several lists: p = array([[ 0.2, 0.8], [ 0.5, 0.5], [ 0.3, 0.7]]) each list in the array 'p' is of size N -- in this case N = 2. i have a