Re: [Numpy-discussion] question about subtraction and shape

2011-09-01 Thread Tony Yu
On Thu, Sep 1, 2011 at 5:33 PM, Jonas Wallin wrote: > Hello, > > I implemented the following line of code: > > Gami[~index0].shape > (100,) > sigma.shape > (1,1) > Gami[~index0] = Gam[~index0] - sigma**2 > > I get the error message: > *** ValueError: array is not broadcastable

[Numpy-discussion] question about subtraction and shape

2011-09-01 Thread Jonas Wallin
Hello, I implemented the following line of code: Gami[~index0].shape > (100,) sigma.shape > (1,1) Gami[~index0] = Gam[~index0] - sigma**2 I get the error message: *** ValueError: array is not broadcastable to correct shape apparently *temp* = Gam[~index0] - sigma**2 *temp*.