I'm a newbie to python. Can anyone tell me why the following little program
complains about incorrect dimensions?
<snip>
import pylab
from pylab import *
n = 10; m = 2*n;
A = randn(m,n);
b = A*rand(n,1) + 2*rand(m,1);
</snip>
The actual error I receive is,
<snip>
b = A*rand(n,1) + 2*rand(m,1);
ValueError: shape mismatch: objects cannot be broadcast to a single shape
</snip>
This is supposed to be doing a matrix multply of an (m,n)(n,1). This results in
an (m,1). This should then be able to be added to the 2*rand(m,1), but, its not
for some reason.
Ideas?
Joe
_________________________________________________________________
Windows Live Hotmail now works up to 70% faster.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008
--
http://mail.python.org/mailman/listinfo/python-list