On 12/18/2009 5:54 PM, Keith Goodman wrote:
> On Fri, Dec 18, 2009 at 2:51 PM, Wayne Watson
> <sierra_mtnv...@sbcglobal.net>  wrote:
>> That should do it. Thanks. How do I get the scalar result by itself?
>
>>> np.dot(x.T,x)[0,0]
>     14
>
> or
>
>>> x = np.array([1,2,3])
>>> np.dot(x,x)
>     14


or np.dot(x.flat,x.flat)

fwiw,
Alan Isaac
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to