Re: [Numpy-discussion] numpy.dot behavior with column vector and length 1 vector
by Travis Oliphant other posts by this author
Jan 28 2006 6:56PM messages near this date
Re: [Numpy-discussion] numpy.dot behavior with column vector and length 1 vector
|
[Numpy-discussion] numpy can't use ACML
Brendan Simons wrote:
> Is this behavior expected? If so, why am I wrong in assuming these
> statements should all return the same result?
>
> PyCrust 0.9.5 - The Flakiest Python Shell
> Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy
> >>> colVect = numpy.ones((3, 1))
> >>> colVect * 5.3
> array([[ 5.3],
> [ 5.3],
> [ 5.3]])
> >>> numpy.dot(colVect, 5.3)
> array([[ 5.3],
> [ 5.3],
> [ 5.3]])
> >>> colVect * [5.3]
> array([[ 5.3],
> [ 5.3],
> [ 5.3]])
> >>> numpy.dot(colVect, [5.3])
> array([ 5.3, 0. , 0. ])
This is a dotblas bug. You can always tell by testing out the original
dot function:
from numpy.core.multiarray import dot as dot_
dot_(colVect, [5.3])
does not give this result.
-Travis
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Brendan Simons
Travis Oliphant
Travis Oliphant
|