[Numpy-discussion] try to solve issue #2649 and revisit #473
huangkandiy@gmai...
huangkandiy@gmai...
Wed Apr 3 14:18:09 CDT 2013
I know matrix will call the dot function of ndarray. However, that will not
give the answer we expect. A 5*5 matrix multiplies another matrix, we
expect answer to be error or a 5*? matrix, not a 1*5 matrix.
As ticket 2649 said, I * I * x or I.dot(I.dot(x)) should be as same as I *
x. But it will return an error because I and I.dot(x) are not aligned.
On Wed, Apr 3, 2013 at 2:50 PM, Alan G Isaac <alan.isaac@gmail.com> wrote:
> On 4/3/2013 2:44 PM, huangkandiy@gmail.com wrote:
> > I suggest add function dot to matrix
>
> >>> import numpy as np; x = np.arange(5); I = np.asmatrix(np.identity(5));
> >>> I.dot(x)
> matrix([[ 0., 1., 2., 3., 4.]])
>
>
> Alan Isaac
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
Kan Huang
Department of Applied math & Statistics
Stony Brook University
917-767-8018
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130403/71df8e88/attachment.html
More information about the NumPy-Discussion
mailing list