[Numpy-discussion] Detect subclass of ndarray
Alan G Isaac
Sat Mar 24 08:44:23 CDT 2007
On Fri, 23 Mar 2007, Charles R Harris apparently wrote:
> the following gives the wrong result:
> In : I = matrix(eye(2))
> In : I*ones(2)
> Out: matrix([[ 1., 1.]])
> where the output should be a column vector.
Why should this output a column?
I would prefer an exception.
Add the axis if you want it:
Matrix multiplication should only work
for 2d arrays.
Making a larger point:
I find the mixing of matrices and arrays
when using ``*`` to be highly suspect and
far too implicit. This is going to bite
Finally, however else this moves forward,
I think making ``*`` work differently than
``dot`` is a bad idea.
More information about the Numpy-discussion