On 8 Feb 2015 13:39, "Simon Wood" <sgwoo...@gmail.com> wrote: > > I find the broadcasting aspect of Numpy a turn off. If I go to add a 1x3 vector to a 3x1 vector, I want the program to warn me or error out. I don't want it to do something under the covers that has no mathematical basis or definition. Also, Octave may provide a warning, but Matlab errors out..."Matrix dimensions must agree". Which they must, at least in my world.
There may be another matlab/numpy idiom clash here that's affecting this: in MATLAB, vectors are always 1 x n or n x 1, because of the matrix focused history. In numpy the idiomatic thing to do is to make vectors one-dimensional, and then this confusion cannot arise. Indeed, the only cases I'm thinking of where I even create a 3x1 or 1x3 vector in the first place are when I'm about to do something clever with broadcasting. -n
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion